Agenda: ex-ganeti-create-vm.htm

File ex-ganeti-create-vm.htm, 47.1 KB (added by b.candler, 5 years ago)
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5  <meta http-equiv="Content-Style-Type" content="text/css" />
6  <meta name="generator" content="pandoc" />
7  <title>Ganeti VM building, replication and migration</title>
8  <style type="text/css">code{white-space: pre;}</style>
9  <link href="data:text/css,%2F%2A%0A%20%20%20%20Buttondown%0A%20%20%20%20A%20Markdown%2FMultiMarkdown%2FPandoc%20HTML%20output%20CSS%20stylesheet%0A%20%20%20%20Author%3A%20Ryan%20Gray%0A%20%20%20%20Date%3A%2015%20Feb%202011%0A%20%20%20%20Revised%3A%2021%20Feb%202012%0A%20%20%20%0A%20%20%20%20General%20style%20is%20clean%2C%20with%20minimal%20re%2Ddefinition%20of%20the%20defaults%20or%20%0A%20%20%20%20overrides%20of%20user%20font%20settings%2E%20The%20body%20text%20and%20header%20styles%20are%20%0A%20%20%20%20left%20alone%20except%20title%2C%20author%20and%20date%20classes%20are%20centered%2E%20A%20Pandoc%20TOC%20%0A%20%20%20%20is%20not%20printed%2C%20URLs%20are%20printed%20after%20hyperlinks%20in%20parentheses%2E%20%0A%20%20%20%20Block%20quotes%20are%20italicized%2E%20Tables%20are%20lightly%20styled%20with%20lines%20above%20%0A%20%20%20%20and%20below%20the%20table%20and%20below%20the%20header%20with%20a%20boldface%20header%2E%20Code%20%0A%20%20%20%20blocks%20are%20line%20wrapped%2E%20%0A%20%0A%20%20%20%20All%20elements%20that%20Pandoc%20and%20MultiMarkdown%20use%20should%20be%20listed%20here%2C%20even%20%0A%20%20%20%20if%20the%20style%20is%20empty%20so%20you%20can%20easily%20add%20styling%20to%20anything%2E%0A%20%20%20%20%0A%20%20%20%20There%20are%20some%20elements%20in%20here%20for%20HTML5%20output%20of%20Pandoc%2C%20but%20I%20have%20not%20%0A%20%20%20%20gotten%20around%20to%20testing%20that%20yet%2E%0A%2A%2F%0A%20%0A%2F%2A%20NOTES%3A%0A%20%0A%20%20%20%20Stuff%20tried%20and%20failed%3A%0A%20%20%20%20%0A%20%20%20%20It%20seems%20that%20specifying%20font%2Dfamily%3Aserif%20in%20Safari%20will%20always%20use%20%0A%20%20%20%20Times%20New%20Roman%20rather%20than%20the%20user%27s%20preferences%20setting%2E%0A%20%20%20%20%0A%20%20%20%20Making%20the%20font%20size%20different%20or%20a%20fixed%20value%20for%20print%20in%20case%20the%20screen%20%0A%20%20%20%20font%20size%20is%20making%20the%20print%20font%20too%20big%3A%20Making%20font%2Dsize%20different%20for%20%0A%20%20%20%20print%20than%20for%20screen%20causes%20horizontal%20lines%20to%20disappear%20in%20math%20when%20using%20%0A%20%20%20%20MathJax%20under%20Safari%2E%0A%2A%2F%0A%20%0A%2F%2A%20%2D%2D%2D%2D%20Front%20Matter%20%2D%2D%2D%2D%20%2A%2F%0A%20%0A%2F%2A%20Pandoc%20header%20DIV%2E%20Contains%20%2Etitle%2C%20%2Eauthor%20and%20%2Edate%2E%20Comes%20before%20div%23TOC%2E%20%0A%20%20%20Only%20appears%20if%20one%20of%20those%20three%20are%20in%20the%20document%2E%0A%2A%2F%0A%20%0Adiv%23header%2C%20header%0A%20%20%20%20%7B%0A%20%20%20%20%2F%2A%20Put%20border%20on%20bottom%2E%20Separates%20it%20from%20TOC%20or%20body%20that%20comes%20after%20it%2E%20%2A%2F%0A%20%20%20%20border%2Dbottom%3A%201px%20solid%20%23aaa%3B%0A%20%20%20%20margin%2Dbottom%3A%200%2E5em%3B%0A%20%20%20%20%7D%0A%20%0A%2Etitle%20%2F%2A%20Pandoc%20title%20header%20%28h1%2Etitle%29%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20text%2Dalign%3A%20center%3B%0A%20%20%20%20%7D%0A%20%0A%2Eauthor%2C%20%2Edate%20%2F%2A%20Pandoc%20author%28s%29%20and%20date%20headers%20%28h2%2Eauthor%20and%20h3%2Edate%29%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20text%2Dalign%3A%20center%3B%0A%20%20%20%20%7D%0A%20%0A%2F%2A%20Pandoc%20table%20of%20contents%20DIV%20when%20using%20the%20%2D%2Dtoc%20option%2E%0A%20%20%20NOTE%3A%20this%20doesn%27t%20support%20Pandoc%27s%20%2D%2Did%2Dprefix%20option%20for%20%23TOC%20and%20%23header%2E%20%0A%20%20%20Probably%20would%20need%20to%20use%20div%5Bid%24%3D%27TOC%27%5D%20and%20div%5Bid%24%3D%27header%27%5D%20as%20selectors%2E%0A%2A%2F%0A%20%0Adiv%23TOC%2C%20nav%23TOC%0A%20%20%20%20%7B%0A%20%20%20%20%2F%2A%20Put%20border%20on%20bottom%20to%20separate%20it%20from%20body%2E%20%2A%2F%0A%20%20%20%20border%2Dbottom%3A%201px%20solid%20%23aaa%3B%0A%20%20%20%20margin%2Dbottom%3A%200%2E5em%3B%0A%20%20%20%20%7D%0A%20%0A%40media%20print%0A%20%20%20%20%7B%0A%20%20%20%20div%23TOC%2C%20nav%23TOC%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%2F%2A%20Don%27t%20display%20TOC%20in%20print%20%2A%2F%0A%20%20%20%20%20%20%20%20display%3A%20none%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%0A%2F%2A%20%2D%2D%2D%2D%20Headers%20and%20sections%20%2D%2D%2D%2D%20%2A%2F%0A%20%0Ah1%2C%20h2%2C%20h3%2C%20h4%2C%20h5%2C%20h6%0A%7B%0A%20%20%20%20font%2Dfamily%3A%20%22Helvetica%20Neue%22%2C%20Helvetica%2C%20%22Liberation%20Sans%22%2C%20Calibri%2C%20Arial%2C%20sans%2Dserif%3B%20%2F%2A%20Sans%2Dserif%20headers%20%2A%2F%0A%20%0A%20%20%20%20%2F%2A%20font%2Dfamily%3A%20%22Liberation%20Serif%22%2C%20%22Georgia%22%2C%20%22Times%20New%20Roman%22%2C%20serif%3B%20%2F%2A%20Serif%20headers%20%2A%2F%0A%20%0A%20%20%20%20page%2Dbreak%2Dafter%3A%20avoid%3B%20%2F%2A%20Firefox%2C%20Chrome%2C%20and%20Safari%20do%20not%20support%20the%20property%20value%20%22avoid%22%20%2A%2F%0A%7D%0A%20%0A%2F%2A%20Pandoc%20with%20%2D%2Dsection%2Ddivs%20option%20%2A%2F%0A%20%0Adiv%20div%2C%20section%20section%20%2F%2A%20Nested%20sections%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20margin%2Dleft%3A%202em%3B%20%2F%2A%20This%20will%20increasingly%20indent%20nested%20header%20sections%20%2A%2F%0A%20%20%20%20%7D%0A%20%0Ap%20%7B%7D%0A%20%0Ablockquote%0A%20%20%20%20%7B%20%0A%20%20%20%20font%2Dstyle%3A%20italic%3B%0A%20%20%20%20%7D%0A%20%0Ali%20%2F%2A%20All%20list%20items%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%0Ali%20%3E%20p%20%2F%2A%20Loosely%20spaced%20list%20item%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20margin%2Dtop%3A%201em%3B%20%2F%2A%20IE%3A%20lack%20of%20space%20above%20a%20%3Cli%3E%20when%20the%20item%20is%20inside%20a%20%3Cp%3E%20%2A%2F%0A%20%20%20%20%7D%0A%20%0Aul%20%2F%2A%20Whole%20unordered%20list%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%0Aul%20li%20%2F%2A%20Unordered%20list%20item%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%0Aol%20%2F%2A%20Whole%20ordered%20list%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%0Aol%20li%20%2F%2A%20Ordered%20list%20item%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%0Ahr%20%7B%7D%0A%20%0A%2F%2A%20%2D%2D%2D%2D%20Some%20span%20elements%20%2D%2D%2D%20%2A%2F%0A%20%0Asub%20%2F%2A%20Subscripts%2E%20Pandoc%3A%20H%7E2%7EO%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%0Asup%20%2F%2A%20Superscripts%2E%20Pandoc%3A%20The%202%5End%5E%20try%2E%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%20%20%20%0Aem%20%2F%2A%20Emphasis%2E%20Markdown%3A%20%2Aemphasis%2A%20or%20%5Femphasis%5F%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%20%20%20%0Aem%20%3E%20em%20%2F%2A%20Emphasis%20within%20emphasis%3A%20%2AThis%20is%20all%20%2Aemphasized%2A%20except%20that%2A%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20font%2Dstyle%3A%20normal%3B%0A%20%20%20%20%7D%0A%20%0Astrong%20%2F%2A%20Markdown%20%2A%2Astrong%2A%2A%20or%20%5F%5Fstrong%5F%5F%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%0A%2F%2A%20%2D%2D%2D%2D%20Links%20%28anchors%29%20%2D%2D%2D%2D%20%2A%2F%0A%20%0Aa%20%2F%2A%20All%20links%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%2F%2A%20Keep%20links%20clean%2E%20On%20screen%2C%20they%20are%20colored%3B%20in%20print%2C%20they%20do%20nothing%20anyway%2E%20%2A%2F%0A%20%20%20%20text%2Ddecoration%3A%20none%3B%0A%20%20%20%20%7D%0A%20%0A%40media%20screen%0A%20%20%20%20%7B%0A%20%20%20%20a%3Ahover%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%2F%2A%20On%20hover%2C%20we%20indicate%20a%20bit%20more%20that%20it%20is%20a%20link%2E%20%2A%2F%0A%20%20%20%20%20%20%20%20text%2Ddecoration%3A%20underline%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%0A%40media%20print%0A%20%20%20%20%7B%0A%20%20%20%20a%20%20%20%7B%0A%20%20%20%20%20%20%20%20%2F%2A%20In%20print%2C%20a%20colored%20link%20is%20useless%2C%20so%20un%2Dstyle%20it%2E%20%2A%2F%0A%20%20%20%20%20%20%20%20color%3A%20black%3B%0A%20%20%20%20%20%20%20%20background%3A%20transparent%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20a%5Bhref%5E%3D%22http%3A%2F%2F%22%5D%3Aafter%2C%20a%5Bhref%5E%3D%22https%3A%2F%2F%22%5D%3Aafter%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%2F%2A%20However%2C%20links%20that%20go%20somewhere%20else%2C%20might%20be%20useful%20to%20the%20reader%2C%0A%20%20%20%20%20%20%20%20%20%20%20so%20for%20http%20and%20https%20links%2C%20print%20the%20URL%20after%20what%20was%20the%20link%20%0A%20%20%20%20%20%20%20%20%20%20%20text%20in%20parens%0A%20%20%20%20%20%20%20%20%2A%2F%0A%20%20%20%20%20%20%20%20content%3A%20%22%20%28%22%20attr%28href%29%20%22%29%20%22%3B%0A%20%20%20%20%20%20%20%20font%2Dsize%3A%2090%25%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%0A%2F%2A%20%2D%2D%2D%2D%20Images%20%2D%2D%2D%2D%20%2A%2F%0A%20%0Aimg%0A%20%20%20%20%7B%0A%20%20%20%20%2F%2A%20Let%20it%20be%20inline%20left%2Fright%20where%20it%20wants%20to%20be%2C%20but%20verticality%20make%20%0A%20%20%20%20%20%20%20it%20in%20the%20middle%20to%20look%20nicer%2C%20but%20opinions%20differ%2C%20and%20if%20in%20a%20multi%2Dline%20%0A%20%20%20%20%20%20%20paragraph%2C%20it%20might%20not%20be%20so%20great%2E%20%0A%20%20%20%20%2A%2F%0A%20%20%20%20vertical%2Dalign%3A%20middle%3B%0A%20%20%20%20%7D%0A%20%0Adiv%2Efigure%20%2F%2A%20Pandoc%20figure%2Dstyle%20image%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%2F%2A%20Center%20the%20image%20and%20caption%20%2A%2F%0A%20%20%20%20margin%2Dleft%3A%20auto%3B%0A%20%20%20%20margin%2Dright%3A%20auto%3B%0A%20%20%20%20text%2Dalign%3A%20center%3B%0A%20%20%20%20font%2Dstyle%3A%20italic%3B%0A%20%20%20%20%7D%0A%20%0Ap%2Ecaption%20%2F%2A%20Pandoc%20figure%2Dstyle%20caption%20within%20div%2Efigure%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%2F%2A%20Inherits%20div%2Efigure%20props%20by%20default%20%2A%2F%0A%20%20%20%20%7D%0A%20%0A%2F%2A%20%2D%2D%2D%2D%20Code%20blocks%20and%20spans%20%2D%2D%2D%2D%20%2A%2F%0A%20%0Apre%2C%20code%20%0A%20%20%20%20%7B%0A%20%20%20%20background%2Dcolor%3A%20%23fdf7ee%3B%0A%20%20%20%20%2F%2A%20BEGIN%20word%20wrap%20%2A%2F%0A%20%20%20%20%2F%2A%20Need%20all%20the%20following%20to%20word%20wrap%20instead%20of%20scroll%20box%20%2A%2F%0A%20%20%20%20%2F%2A%20This%20will%20override%20the%20overflow%3Aauto%20if%20present%20%2A%2F%0A%20%20%20%20white%2Dspace%3A%20pre%2Dwrap%3B%20%2F%2A%20css%2D3%20%2A%2F%0A%20%20%20%20white%2Dspace%3A%20%2Dmoz%2Dpre%2Dwrap%20%21important%3B%20%2F%2A%20Mozilla%2C%20since%201999%20%2A%2F%0A%20%20%20%20white%2Dspace%3A%20%2Dpre%2Dwrap%3B%20%2F%2A%20Opera%204%2D6%20%2A%2F%0A%20%20%20%20white%2Dspace%3A%20%2Do%2Dpre%2Dwrap%3B%20%2F%2A%20Opera%207%20%2A%2F%0A%20%20%20%20word%2Dwrap%3A%20break%2Dword%3B%20%2F%2A%20Internet%20Explorer%205%2E5%2B%20%2A%2F%0A%20%20%20%20%2F%2A%20END%20word%20wrap%20%2A%2F%0A%20%20%20%20%7D%0A%20%0Apre%20%2F%2A%20Code%20blocks%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%2F%2A%20Distinguish%20pre%20blocks%20from%20other%20text%20by%20more%20than%20the%20font%20with%20a%20background%20tint%2E%20%2A%2F%0A%20%20%20%20padding%3A%200%2E5em%3B%20%2F%2A%20Since%20we%20have%20a%20background%20color%20%2A%2F%0A%20%20%20%20border%2Dradius%3A%205px%3B%20%2F%2A%20Softens%20it%20%2A%2F%0A%20%20%20%20%2F%2A%20Give%20it%20a%20some%20definition%20%2A%2F%0A%20%20%20%20border%3A%201px%20solid%20%23aaa%3B%0A%20%20%20%20%2F%2A%20Set%20it%20off%20left%20and%20right%2C%20seems%20to%20look%20a%20bit%20nicer%20when%20we%20have%20a%20background%20%2A%2F%0A%20%20%20%20margin%2Dleft%3A%20%200%2E5em%3B%0A%20%20%20%20margin%2Dright%3A%200%2E5em%3B%0A%20%20%20%20%7D%0A%20%0A%40media%20screen%0A%20%20%20%20%7B%0A%20%20%20%20pre%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%2F%2A%20On%20screen%2C%20use%20an%20auto%20scroll%20box%20for%20long%20lines%2C%20unless%20word%2Dwrap%20is%20enabled%20%2A%2F%0A%20%20%20%20%20%20%20%20white%2Dspace%3A%20pre%3B%0A%20%20%20%20%20%20%20%20overflow%3A%20auto%3B%0A%20%20%20%20%20%20%20%20%2F%2A%20Dotted%20looks%20better%20on%20screen%20and%20solid%20seems%20to%20print%20better%2E%20%2A%2F%0A%20%20%20%20%20%20%20%20border%3A%201px%20dotted%20%23777%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%0Acode%20%2F%2A%20All%20inline%20code%20spans%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%0Ap%20%3E%20code%2C%20li%20%3E%20code%20%2F%2A%20Code%20spans%20in%20paragraphs%20and%20tight%20lists%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%2F%2A%20Pad%20a%20little%20from%20adjacent%20text%20%2A%2F%0A%20%20%20%20padding%2Dleft%3A%20%202px%3B%0A%20%20%20%20padding%2Dright%3A%202px%3B%0A%20%20%20%20%7D%0A%20%20%20%20%0Ali%20%3E%20p%20code%20%2F%2A%20Code%20span%20in%20a%20loose%20list%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%2F%2A%20We%20have%20room%20for%20some%20more%20background%20color%20above%20and%20below%20%2A%2F%0A%20%20%20%20padding%3A%202px%3B%0A%20%20%20%20%7D%0A%20%0A%2F%2A%20%2D%2D%2D%2D%20Math%20%2D%2D%2D%2D%20%2A%2F%0A%20%0Aspan%2Emath%20%2F%2A%20Pandoc%20inline%20math%20default%20and%20%2D%2Djsmath%20inline%20math%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%2F%2A%20Tried%20font%2Dstyle%3Aitalic%20here%2C%20and%20it%20messed%20up%20MathJax%20rendering%20in%20some%20browsers%2E%20Maybe%20don%27t%20mess%20with%20at%20all%2E%20%2A%2F%0A%20%20%20%20%7D%0A%20%20%20%20%0Adiv%2Emath%20%2F%2A%20Pandoc%20%2D%2Djsmath%20display%20math%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%20%20%20%0Aspan%2ELaTeX%20%2F%2A%20Pandoc%20%2D%2Dlatexmathml%20math%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%20%0A%20%0Aeq%20%2F%2A%20Pandoc%20%2D%2Dgladtex%20math%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%20%0A%20%0A%2F%2A%20%2D%2D%2D%2D%20Tables%20%2D%2D%2D%2D%20%2A%2F%0A%20%0A%2F%2A%20%20A%20clean%20textbook%2Dlike%20style%20with%20horizontal%20lines%20above%20and%20below%20and%20under%20%0A%20%20%20%20the%20header%2E%20Rows%20highlight%20on%20hover%20to%20help%20scanning%20the%20table%20on%20screen%2E%0A%2A%2F%0A%20%0Atable%0A%20%20%20%20%7B%0A%20%20%20%20border%2Dcollapse%3A%20collapse%3B%0A%20%20%20%20border%2Dspacing%3A%200%3B%20%2F%2A%20IE%206%20%2A%2F%0A%20%0A%20%20%20%20border%2Dbottom%3A%202pt%20solid%20%23000%3B%0A%20%20%20%20border%2Dtop%3A%202pt%20solid%20%23000%3B%20%2F%2A%20The%20caption%20on%20top%20will%20not%20have%20a%20bottom%2Dborder%20%2A%2F%0A%20%0A%20%20%20%20%2F%2A%20Center%20%2A%2F%0A%20%20%20%20margin%2Dleft%3A%20auto%3B%0A%20%20%20%20margin%2Dright%3A%20auto%3B%0A%20%20%20%20%7D%0A%20%20%20%20%0Athead%20%2F%2A%20Entire%20table%20header%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20border%2Dbottom%3A%201pt%20solid%20%23000%3B%0A%20%20%20%20background%2Dcolor%3A%20%23eee%3B%20%2F%2A%20Does%20this%20BG%20print%20well%3F%20%2A%2F%0A%20%20%20%20%7D%0A%20%0Atr%2Eheader%20%2F%2A%20Each%20header%20row%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%20%0A%20%0Atbody%20%2F%2A%20Entire%20table%20%20body%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%0A%2F%2A%20Table%20body%20rows%20%2A%2F%0A%20%0Atr%20%20%7B%0A%20%20%20%20%7D%0Atr%2Eodd%3Ahover%2C%20tr%2Eeven%3Ahover%20%2F%2A%20Use%20%2Eodd%20and%20%2Eeven%20classes%20to%20avoid%20styling%20rows%20in%20other%20tables%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20background%2Dcolor%3A%20%23eee%3B%0A%20%20%20%20%7D%0A%20%20%20%20%0A%2F%2A%20Odd%20and%20even%20rows%20%2A%2F%0Atr%2Eodd%20%7B%7D%0Atr%2Eeven%20%7B%7D%0A%20%0Atd%2C%20th%20%2F%2A%20Table%20cells%20and%20table%20header%20cells%20%2A%2F%0A%20%20%20%20%7B%20%0A%20%20%20%20vertical%2Dalign%3A%20top%3B%20%2F%2A%20Word%20%2A%2F%0A%20%20%20%20vertical%2Dalign%3A%20baseline%3B%20%2F%2A%20Others%20%2A%2F%0A%20%20%20%20padding%2Dleft%3A%20%20%200%2E5em%3B%0A%20%20%20%20padding%2Dright%3A%20%200%2E5em%3B%0A%20%20%20%20padding%2Dtop%3A%20%20%20%200%2E2em%3B%0A%20%20%20%20padding%2Dbottom%3A%200%2E2em%3B%0A%20%20%20%20%7D%0A%20%20%20%20%0A%2F%2A%20Removes%20padding%20on%20left%20and%20right%20of%20table%20for%20a%20tight%20look%2E%20Good%20if%20thead%20has%20no%20background%20color%2A%2F%0A%2F%2A%0Atr%20td%3Alast%2Dchild%2C%20tr%20th%3Alast%2Dchild%0A%20%20%20%20%7B%0A%20%20%20%20padding%2Dright%3A%200%3B%0A%20%20%20%20%7D%0Atr%20td%3Afirst%2Dchild%2C%20tr%20th%3Afirst%2Dchild%20%0A%20%20%20%20%7B%0A%20%20%20%20padding%2Dleft%3A%200%3B%0A%20%20%20%20%7D%0A%2A%2F%0A%20%0Ath%20%2F%2A%20Table%20header%20cells%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20font%2Dweight%3A%20bold%3B%20%0A%20%20%20%20%7D%0A%20%0Atfoot%20%2F%2A%20Table%20footer%20%28what%20appears%20here%20if%20caption%20is%20on%20top%3F%29%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%0Acaption%20%2F%2A%20This%20is%20for%20a%20table%20caption%20tag%2C%20not%20the%20p%2Ecaption%20Pandoc%20uses%20in%20a%20div%2Efigure%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20caption%2Dside%3A%20top%3B%0A%20%20%20%20border%3A%20none%3B%0A%20%20%20%20font%2Dsize%3A%200%2E9em%3B%0A%20%20%20%20font%2Dstyle%3A%20italic%3B%0A%20%20%20%20text%2Dalign%3A%20center%3B%0A%20%20%20%20margin%2Dbottom%3A%200%2E3em%3B%20%2F%2A%20Good%20for%20when%20on%20top%20%2A%2F%0A%20%20%20%20padding%2Dbottom%3A%200%2E2em%3B%0A%20%20%20%20%7D%0A%20%0A%2F%2A%20%2D%2D%2D%2D%20Definition%20lists%20%2D%2D%2D%2D%20%2A%2F%0A%20%0Adl%20%2F%2A%20The%20whole%20list%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20border%2Dtop%3A%202pt%20solid%20black%3B%0A%20%20%20%20padding%2Dtop%3A%200%2E5em%3B%0A%20%20%20%20border%2Dbottom%3A%202pt%20solid%20black%3B%0A%20%20%20%20%7D%0A%20%0Adt%20%2F%2A%20Definition%20term%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20font%2Dweight%3A%20bold%3B%0A%20%20%20%20%7D%0A%20%0Add%2Bdt%20%2F%2A%202nd%20or%20greater%20term%20in%20the%20list%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20border%2Dtop%3A%201pt%20solid%20black%3B%0A%20%20%20%20padding%2Dtop%3A%200%2E5em%3B%0A%20%20%20%20%7D%0A%20%20%20%20%0Add%20%2F%2A%20A%20definition%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20margin%2Dbottom%3A%200%2E5em%3B%0A%20%20%20%20%7D%0A%20%0Add%2Bdd%20%2F%2A%202nd%20or%20greater%20definition%20of%20a%20term%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20border%2Dtop%3A%201px%20solid%20black%3B%20%2F%2A%20To%20separate%20multiple%20definitions%20%2A%2F%0A%20%20%20%20%7D%0A%20%20%20%20%0A%2F%2A%20%2D%2D%2D%2D%20Footnotes%20%2D%2D%2D%2D%20%2A%2F%0A%20%0Aa%2Efootnote%2C%20a%2EfootnoteRef%20%7B%20%2F%2A%20Pandoc%2C%20MultiMarkdown%20footnote%20links%20%2A%2F%0A%20%20%20%20font%2Dsize%3A%20small%3B%20%0A%20%20%20%20vertical%2Dalign%3A%20text%2Dtop%3B%0A%7D%0A%20%0Aa%5Bhref%5E%3D%22%23fnref%22%5D%2C%20a%2Ereversefootnote%20%2F%2A%20Pandoc%2C%20MultiMarkdown%2C%20%3F%3F%20footnote%20back%20links%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%0A%40media%20print%0A%20%20%20%20%7B%0A%20%20%20%20a%5Bhref%5E%3D%22%23fnref%22%5D%2C%20a%2Ereversefootnote%20%2F%2A%20Pandoc%2C%20MultiMarkdown%20%2A%2F%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%2F%2A%20Don%27t%20display%20these%20at%20all%20in%20print%20since%20the%20arrow%20is%20only%20something%20to%20click%20on%20%2A%2F%0A%20%20%20%20%20%20%20%20display%3A%20none%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%20%20%0Adiv%2Efootnotes%20%2F%2A%20Pandoc%20footnotes%20div%20at%20end%20of%20the%20document%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%20%20%20%0Adiv%2Efootnotes%20li%5Bid%5E%3D%22fn%22%5D%20%2F%2A%20A%20footnote%20item%20within%20that%20div%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%0A%2F%2A%20You%20can%20class%20stuff%20as%20%22noprint%22%20to%20not%20print%2E%20%0A%20%20%20Useful%20since%20you%20can%27t%20set%20this%20media%20conditional%20inside%20an%20HTML%20element%27s%20%0A%20%20%20style%20attribute%20%28I%20think%29%2C%20and%20you%20don%27t%20want%20to%20make%20another%20stylesheet%20that%20%0A%20%20%20imports%20this%20one%20and%20adds%20a%20class%20just%20to%20do%20this%2E%0A%2A%2F%0A%20%0A%40media%20print%0A%20%20%20%20%7B%0A%20%20%20%20%2Enoprint%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20display%3Anone%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A" rel="stylesheet" type="text/css" />
10</head>
11<body>
12<div id="header">
13<h1 class="title">Ganeti VM building, replication and migration</h1>
14</div>
15<div id="TOC">
16<ul>
17<li><a href="#objectives"><span class="toc-section-number">1</span> Objectives</a></li>
18<li><a href="#installing-instances-creating-vms"><span class="toc-section-number">2</span> Installing instances (creating VMs)</a><ul>
19<li><a href="#install-an-instance-vm-with-debootstrap"><span class="toc-section-number">2.1</span> Install an instance (VM) with debootstrap</a><ul>
20<li><a href="#replace-the-debootstrap-installer-with-a-newer-version"><span class="toc-section-number">2.1.1</span> Replace the debootstrap installer with a newer version</a></li>
21<li><a href="#set-a-default-root-password-for-all-instances"><span class="toc-section-number">2.1.2</span> Set a default root password for all instances</a></li>
22<li><a href="#configure-parameters-for-our-vm"><span class="toc-section-number">2.1.3</span> Configure parameters for our VM</a></li>
23<li><a href="#create-a-debian-instance"><span class="toc-section-number">2.1.4</span> Create a Debian instance</a></li>
24</ul></li>
25</ul></li>
26<li><a href="#configuring-the-network-service"><span class="toc-section-number">3</span> Configuring the network service</a><ul>
27<li><a href="#install-openssh"><span class="toc-section-number">3.1</span> Install OpenSSH</a></li>
28</ul></li>
29<li><a href="#convert-machines-from-plain-to-drbd"><span class="toc-section-number">4</span> Convert machines from plain to drbd</a></li>
30<li><a href="#migration"><span class="toc-section-number">5</span> Migration!</a><ul>
31<li><a href="#lets-migrate-the-vm-from-the-primary-to-the-secondary-node"><span class="toc-section-number">5.1</span> Let's migrate the VM from the primary to the secondary node</a></li>
32</ul></li>
33<li><a href="#installing-from-cd-if-we-have-the-time"><span class="toc-section-number">6</span> Installing from CD (if we have the time)</a><ul>
34<li><a href="#installing-support-packages"><span class="toc-section-number">6.1</span> Installing support packages</a></li>
35<li><a href="#distributing-iso-images"><span class="toc-section-number">6.2</span> Distributing ISO images</a></li>
36<li><a href="#if-creating-an-instance-using-plain-lvm-based-disks-cd-install"><span class="toc-section-number">6.3</span> If creating an instance using 'plain' (LVM) based disks, CD install</a></li>
37<li><a href="#if-creating-and-instance-with-drbd-disks-cd-install"><span class="toc-section-number">6.4</span> If creating and instance with DRBD disks, CD install</a></li>
38<li><a href="#changing-networks"><span class="toc-section-number">6.5</span> Changing networks</a></li>
39</ul></li>
40</ul>
41</div>
42<h1 id="objectives"><a href="#objectives"><span class="header-section-number">1</span> Objectives</a></h1>
43<ul>
44<li>Learn various ganeti commands</li>
45<li>Install a simple machine, automatically, on an LVM volume</li>
46<li>Convert the machine to drbd</li>
47<li>Use the migrate feature</li>
48</ul>
49<h1 id="installing-instances-creating-vms"><a href="#installing-instances-creating-vms"><span class="header-section-number">2</span> Installing instances (creating VMs)</a></h1>
50<p>Before we create and install VMs, we need to change one setting in the cluster (this should have been done before, but we're doing it to be safe).</p>
51<p>Do this on the MASTER node:</p>
52<pre><code># gnt-cluster modify -H kvm:kernel_path=&quot;&quot;,initrd_path=&quot;&quot;</code></pre>
53<h2 id="install-an-instance-vm-with-debootstrap"><a href="#install-an-instance-vm-with-debootstrap"><span class="header-section-number">2.1</span> Install an instance (VM) with debootstrap</a></h2>
54<p>We are going to install our VMs using debootstrap - we don't feel like spending time installing an OS using an ISO image: it takes too long, and that's not what we would be doing in production if we had many customers or users asking for VMs all the time.</p>
55<p>First, we need to adjust a few things.</p>
56<h3 id="replace-the-debootstrap-installer-with-a-newer-version"><a href="#replace-the-debootstrap-installer-with-a-newer-version"><span class="header-section-number">2.1.1</span> Replace the debootstrap installer with a newer version</a></h3>
57<p>We need to upgrade the debootstrap instance builder for Ganeti - there is a newer one. It fixes some bugs that could give some trouble later.</p>
58<p>First, remove the <code>ganeti-instance-debootstrap</code> that was installed automatically when we installed ganeti:</p>
59<pre><code># apt-get remove ganeti-instance-debootstrap</code></pre>
60<p>You will need to do this on both nodes (a secondary node can become a primary if the primary fails, and must be running the same software as the master).</p>
61<pre><code># apt-get install make
62
63# wget https://ganeti.googlecode.com/files/ganeti-instance-debootstrap-0.14.tar.gz
64# tar xvfz ganeti-instance-debootstrap-0.14.tar.gz
65# cd ganeti-instance-debootstrap-0.14
66# ./configure -prefix=/usr --localstatedir=/var --sysconfdir=/etc
67
68[ some output ]
69
70# make; make install
71
72[ some output ]</code></pre>
73<p>Test that the new &quot;instance OS&quot; type is recognized:</p>
74<pre><code>gnt-os list</code></pre>
75<p>This should show: debootstrap+default</p>
76<h3 id="set-a-default-root-password-for-all-instances"><a href="#set-a-default-root-password-for-all-instances"><span class="header-section-number">2.1.2</span> Set a default root password for all instances</a></h3>
77<p>We would like all our instances to have the same root password. Ganeti provides us with a mechanism for this, which comprises two files: a small shell script, and a data file containing the desired password.</p>
78<p>You need to be in the directory <code>ganeti-instance-debootstrap-0.14</code> you extracted above.</p>
79<pre><code># mkdir -p /etc/ganeti/instance-debootstrap/hooks/confdata
80# cp examples/hooks/defaultpasswords /etc/ganeti/instance-debootstrap/hooks/
81# cp examples/hooks/confdata/defaultpasswords \
82    /etc/ganeti/instance-debootstrap/hooks/confdata/</code></pre>
83<p>Now, edit <code>/etc/ganeti/instance-debootstrap/hooks/confdata/defaultpasswords</code> and change the default password from <code>s3cr3t</code> to the password we use in class. This file should be just one line:</p>
84<pre><code>root:XXXXXX</code></pre>
85<p>where XXXXXX is the password.</p>
86<h3 id="configure-parameters-for-our-vm"><a href="#configure-parameters-for-our-vm"><span class="header-section-number">2.1.3</span> Configure parameters for our VM</a></h3>
87<p>We're almost ready to build our VM. Before, we need to set a few parameters so it builds the version and architecture we want.</p>
88<p>Modify the file <code>/etc/default/ganeti-instance-debootstrap</code>, which contains the default <code>debootstrap</code> settings for Ganeti.</p>
89<p>If you take a quick look, you can see various options that we covered before in the scripted installs:</p>
90<p><code>ARCH</code>, <code>SUITE</code> and <code>EXTRA_PKGS</code> in particular, control which version of the OS and architecture, as well as which package, get installed.</p>
91<p>We need to override (change) two of these parameters: <code>ARCH</code> and <code>EXTRA_PKGS</code>, but we're not going to modify this file.</p>
92<p>Instead, we'll edit the file <code>/etc/ganeti/instance-debootstrap/variants/default.conf</code>, which allows us to make the change without touching the installed version. Like this, when Ganeti is upgraded, your settings file isn't overwritten.</p>
93<p>Therefore:</p>
94<pre><code># editor /etc/ganeti/instance-debootstrap/variants/default.conf</code></pre>
95<p>And add the following lines:</p>
96<pre><code>ARCH=&quot;amd64&quot;
97EXTRA_PKGS=&quot;acpi-support-base,console-tools,udev,linux-image-amd64,grub2&quot;</code></pre>
98<p>Summary:</p>
99<ul>
100<li>We changed the architecture from i386 to amd64</li>
101<li>We enabled extra packages, including the boot loader GRUB)</li>
102</ul>
103<h3 id="create-a-debian-instance"><a href="#create-a-debian-instance"><span class="header-section-number">2.1.4</span> Create a Debian instance</a></h3>
104<pre><code># gnt-instance add -t plain \
105    -o debootstrap+default \
106    -B memory=512M --disk 0:size=4G \
107    -n vmX.ws.nsrc.org \
108    --no-ip-check --no-name-check \
109    -H kvm:vnc_bind_address=0.0.0.0,kernel_path=&quot;&quot; \
110    debian</code></pre>
111<p>Note: if you are only going to have one disk, instead of writing <code>--disk 0:size=4G</code>, you could simply write <code>-s 4G</code>.</p>
112<p>The build is going to take a while the first time - it should fetch most packages from the local cache, which should speed things up.</p>
113<p>It needs to fetch packages just like for debootstrap in the previous labs. Be patient...</p>
114<pre><code>Sat Jan 18 09:52:14 2014 * disk 0, size 4.0G
115Sat Jan 18 09:52:14 2014 * creating instance disks...
116Sat Jan 18 09:52:15 2014 adding instance debian to cluster config
117Sat Jan 18 09:52:15 2014  - INFO: Waiting for instance debian to sync disks
118Sat Jan 18 09:52:15 2014  - INFO: Instance debian's disks are in sync
119Sat Jan 18 09:52:15 2014 * running the instance OS create scripts...
120Sat Jan 18 10:02:53 2014 * starting instance...</code></pre>
121<p>Ok, the build is done! The good thing is, in the future, Ganeti has cached the image of your host (by default, for two weeks), so if you install more VMs with the same command, it will only take a few seconds to create and start the machine <sup><a href="#fn1" class="footnoteRef" id="fnref1">1</a></sup>.</p>
122<p>Unfortunately, there is currently a problem (bug) currently with this way of installing VMs on Ganeti.</p>
123<p>Your VM will not come up, and KVM will hang with 99% cpu:</p>
124<pre><code># top
125
126...
127  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND
128 5981 root      20   0  765m  11m 3144 S  98.8  1.1   6:05.41 kvm</code></pre>
129<p>Let's fix it.</p>
130<p>Bring down the host (shutdown):</p>
131<pre><code># gnt-instance shutdown --timeout=0 debian
132Waiting for job 211 for debian ...</code></pre>
133<p>We're going to boot the instance using the kernel from the <em>Host</em>, just temporarily, so we can fix the bug:</p>
134<pre><code># gnt-instance start \
135    -H kernel_path=/vmlinuz,initrd_path=/initrd.img,kernel_args=&quot;ro single&quot; \
136    debian</code></pre>
137<p>Wait a few seconds, then start a serial console:</p>
138<pre><code># gnt-instance console debian</code></pre>
139<p>Press ENTER</p>
140<p>You should see:</p>
141<pre><code>Login incorrect.
142Give root password for maintenance
143(or type Control-D to continue):</code></pre>
144<p>Here, enter the password we set for the root (class password). If all goes well, you are in:</p>
145<pre><code>root@debian:~#</code></pre>
146<p>Now we can fix the GRUB bootloader on the VM:</p>
147<p>Note: you are typing this in the console, NOT ON YOUR HOST!</p>
148<p>Update the GRUB bootloader:</p>
149<pre><code># update-grub
150
151Generating grub.cfg ...
152cat: /boot/grub/video.lst: No such file or directory
153Found linux image: /boot/vmlinuz-3.2.0-4-amd64
154Found initrd image: /boot/initrd.img-3.2.0-4-amd64
155done</code></pre>
156<p>Reinstall the boot loader in the boot sector of our VM disk:</p>
157<pre><code># grub-install /dev/vda
158
159Installation finished. No error reported.</code></pre>
160<p>Now you can shutdown the machine (still inside the guest!)</p>
161<pre><code># halt -p
162
163INIT: Switching to runlevel: 0
164INIT: Sending processes the TERM signal
165INIT: Sending processes the KILL signal
166[  247.024934] EXT4-fs (vda1): re-mounted. Opts: (null)
167[  249.108473] ACPI: Preparing to enter system sleep state S5
168[  249.150817] Power down.
169
170Connection to vmX.ws.nsrc.org closed.</code></pre>
171<p>You should be back at the shell prompt of your host. On the host, let's try and restart the instance (VM) normally.</p>
172<pre><code># gnt-instance start debian</code></pre>
173<p>Wait a few seconds, and if all goes well, you should now be able to get a console on your instance, either using <code>gnt-instance console debian</code> or using VNC <sup><a href="#fn2" class="footnoteRef" id="fnref2">2</a></sup></p>
174<p>Our machine still doesn't have any network configuration - we will deal with it now.</p>
175<h1 id="configuring-the-network-service"><a href="#configuring-the-network-service"><span class="header-section-number">3</span> Configuring the network service</a></h1>
176<p>One thing remains to be done - our machines still don't have any network connectivity.</p>
177<p>Log in using VNC to the console of your VM (if you're in doubt which Node it's running on, use</p>
178<pre><code># gnt-instance list -o name,pnode,snodes,oper_ram,nic.bridge/0,network_port,nic.link/0,sda_size,status</code></pre>
179<p>To find out which Node + Port it's listening on.</p>
180<p>Once logged in to the <em>guest</em>:</p>
181<pre><code># ifconfig eth0</code></pre>
182<p>Notice there isn't any IP.</p>
183<p>Remember, that this VM is attached to <code>br-svc</code> from the point of view of the <em>HOST</em>. That network's address and subnet is <code>10.10.255.0/24</code>.</p>
184<p>You will give an IP address to your VM, from the following table:</p>
185<table>
186<thead>
187<tr class="header">
188<th align="center">Cluster/Group</th>
189<th align="center">IP address</th>
190</tr>
191</thead>
192<tbody>
193<tr class="odd">
194<td align="center">Group 1</td>
195<td align="center">10.10.255.1</td>
196</tr>
197<tr class="even">
198<td align="center">Group 2</td>
199<td align="center">10.10.255.17</td>
200</tr>
201<tr class="odd">
202<td align="center">Group 3</td>
203<td align="center">10.10.255.33</td>
204</tr>
205<tr class="even">
206<td align="center">Group 4</td>
207<td align="center">10.10.255.49</td>
208</tr>
209<tr class="odd">
210<td align="center">Group 5</td>
211<td align="center">10.10.255.65</td>
212</tr>
213<tr class="even">
214<td align="center">Group 6</td>
215<td align="center">10.10.255.81</td>
216</tr>
217<tr class="odd">
218<td align="center">Group 7</td>
219<td align="center">10.10.255.97</td>
220</tr>
221</tbody>
222</table>
223<ul>
224<li>The netmask is going to be 255.255.255.0</li>
225<li>The gateway is going to be 10.10.255.254</li>
226</ul>
227<p>We need to edit <code>/etc/network/interfaces</code> and give your VM an IP address from the table above. Do this now, and it should end up looking like this:</p>
228<pre><code>auto lo
229iface lo inet loopback
230
231auto eth0
232iface eth0 inet static
233    address 10.10.255.XX
234    netmask 255.255.255.0
235    gateway 10.10.255.254</code></pre>
236<p>Replace <code>XX</code> with the IP from the table above.</p>
237<p>Finally, modify <code>/etc/resolv.conf</code> and set the nameserver as follows:</p>
238<pre><code>nameserver 10.10.0.241</code></pre>
239<p>You can now bring up the interface:</p>
240<pre><code># ifup eth0</code></pre>
241<p>Test that connectivity works, by pinging the class webserver:</p>
242<pre><code># ping www.ws.nsrc.org</code></pre>
243<p>Does it work ?</p>
244<h2 id="install-openssh"><a href="#install-openssh"><span class="header-section-number">3.1</span> Install OpenSSH</a></h2>
245<p>Let's make sure we are using the in-class package cache:</p>
246<p>Edit the file <code>/etc/apt/apt.conf</code> and add this line:</p>
247<pre><code>Acquire::http::Proxy &quot;http://apt.ws.nsrc.org:3142/&quot;;</code></pre>
248<p>Now we can install OpenSSH <sup><a href="#fn3" class="footnoteRef" id="fnref3">3</a></sup></p>
249<pre><code># apt-get install openssh-server</code></pre>
250<p>You should now be able to log in to your VM as <code>root</code>, on the IP address you gave it earlier (10.10.255.X).</p>
251<h1 id="convert-machines-from-plain-to-drbd"><a href="#convert-machines-from-plain-to-drbd"><span class="header-section-number">4</span> Convert machines from plain to drbd</a></h1>
252<p>Ok, if our machine is going to be running some important services, we need to make it &quot;fully redundant&quot;.</p>
253<p>We can tell Ganeti to convert our machine to go from 'plain' disk (a single copy of the disk in the LVM store of the primary node) to using 'drbd', where data is written at the same time on the primary and secondary nodes.</p>
254<p>This is done with a single command, but first we need to shut down our machine temporarily.</p>
255<pre><code># gnt-instance shutdown debian
256
257Waiting for job 277 for debian ...</code></pre>
258<p>Wait 10-15 seconds, and check that the instance is down:</p>
259<pre><code># gnt-instance list debian</code></pre>
260<p>If it says <code>ADMIN_down</code> for the <code>Status</code>, you can now run the command to convert from <code>plain</code> to <code>drbd</code>:</p>
261<pre><code># gnt-instance modify -t drbd -n vmY.ws.nsrc.org debian</code></pre>
262<p>Immediately the process will begin, and you will see some output similar to this:</p>
263<pre><code>Sat Jan 18 11:33:23 2014 Converting template to drbd
264Sat Jan 18 11:33:23 2014 Creating additional volumes...
265Sat Jan 18 11:33:23 2014 Renaming original volumes...
266Sat Jan 18 11:33:24 2014 Initializing DRBD devices...
267Sat Jan 18 11:33:26 2014  - INFO: Waiting for instance debian to sync disks
268Sat Jan 18 11:33:27 2014  - INFO: - device disk/0:  1.80% done, 1m 1s remaining (estimated)
269Sat Jan 18 11:34:27 2014  - INFO: - device disk/0: 90.10% done, 6s remaining (estimated)
270Sat Jan 18 11:34:34 2014  - INFO: - device disk/0: 99.30% done, 0s remaining (estimated)
271Sat Jan 18 11:34:34 2014  - INFO: - device disk/0: 99.70% done, 0s remaining (estimated)
272Sat Jan 18 11:34:34 2014  - INFO: - device disk/0: 100.00% done, 0s remaining (estimated)
273Sat Jan 18 11:34:34 2014  - INFO: Instance debian's disks are in sync
274Modified instance debian
275 - disk_template -&gt; drbd
276Please don't forget that most parameters take effect only at the next (re)start of the instance initiated by ganeti; restarting from within the instance will not be enough.</code></pre>
277<p>Notice that we provide, as a parameter to <code>-n</code>, the name of the node that we will be replicating to. This node should already be part of the cluster (we did this at the end of the Ganeti install lab).</p>
278<p>Time to restart the instance!</p>
279<pre><code># gnt-instance start debian</code></pre>
280<p>Ok, how do we know that the replication is really taking place ?</p>
281<p>The best way it to use the ifstat package, to see how much bandwidth is being used on our <code>br-rep</code> network, which DRBD is using to copy data from the primary to the secondary node.</p>
282<pre><code># apt-get install ifstat</code></pre>
283<p>Once the ifstat tool is installed, run it to see the network traffic on your network interfaces:</p>
284<pre><code># ifstat -i br-rep
285
286      br-rep
287 KB/s in  KB/s out
288    0.00      0.00
289    2.23     78.96
290    0.00      0.00
291    0.00      0.00</code></pre>
292<p>Now, log in to your guest, and install a package there, for example, apache:</p>
293<p>Log in via SSH to your guest (remember the IP you gave it from the table above- it's in the 10.10.255.0/24 network), and install apache2:</p>
294<pre><code># ssh root@10.10.255.NN     # here NN is the IP of your VM on the service net
295...
296# apt-get install apache2</code></pre>
297<p>Keep an eye on your host window, and see the bandwitdh usage on <code>br-rep</code></p>
298<pre><code>    0.00      0.00
299   86.08   4886.99
300  394.32  14893.37
301  359.16  16467.22
302   23.04    881.35</code></pre>
303<p>You should see the bandwidth utilization peak for a few seconds while the packages are being retrieved and installed.</p>
304<h1 id="migration"><a href="#migration"><span class="header-section-number">5</span> Migration!</a></h1>
305<h2 id="lets-migrate-the-vm-from-the-primary-to-the-secondary-node"><a href="#lets-migrate-the-vm-from-the-primary-to-the-secondary-node"><span class="header-section-number">5.1</span> Let's migrate the VM from the primary to the secondary node</a></h2>
306<pre><code>root@vmX:~# gnt-instance migrate debian
307
308Instance ubuntu-plain will be migrated. Note that migration might
309impact the instance if anything goes wrong (e.g. due to bugs in the
310hypervisor). Continue?
311y/[n]/?: y
312
313Sat Jan 18 04:37:05 2014 Migrating instance ubuntu-plain
314Sat Jan 18 04:37:05 2014 * checking disk consistency between source and target
315Sat Jan 18 04:37:06 2014 * switching node vmX.ws.nsrc.org to secondary mode
316Sat Jan 18 04:37:06 2014 * changing into standalone mode
317Sat Jan 18 04:37:06 2014 * changing disks into dual-master mode
318Sat Jan 18 04:37:07 2014 * wait until resync is done
319Sat Jan 18 04:37:07 2014 * preparing vmX.ws.nsrc.org to accept the instance
320Sat Jan 18 04:37:08 2014 * migrating instance to vmX.ws.nsrc.org
321Sat Jan 18 04:37:10 2014 * starting memory transfer
322Sat Jan 18 04:37:15 2014 * memory transfer complete
323Sat Jan 18 04:37:15 2014 * switching node vmY.ws.nsrc.org to secondary mode
324Sat Jan 18 04:37:16 2014 * wait until resync is done
325Connection to vmY.ws.nsrc.org closed.
326Sat Jan 18 04:37:16 2014 * changing into standalone mode
327Sat Jan 18 04:37:16 2014 * changing disks into single-master mode
328Sat Jan 18 04:37:17 2014 * wait until resync is done
329Sat Jan 18 04:37:17 2014 * done
330
331root@vmX:~#</code></pre>
332<p>Verify that the instance is now running on the secondary node:</p>
333<p>(remember, all gnt-* commands must be run from the MASTER node)</p>
334<pre><code># gnt-instance list -o name,pnode,snodes,oper_ram,nic.bridge/0,network_port,nic.link/0,sda_size,status
335
336Instance Primary_node      ConfigMaxMem Memory NicBridge/0 Network_port NicLink/0 Disk/0 Status
337debian   vmY.ws.nsrc.org           512M   512M br-lan      11000        br-lan      4.0G running</code></pre>
338<p>Note the VNC port at the same time, and reconnect to the VNC console on the primary node, port as listed in the output above.</p>
339<h1 id="installing-from-cd-if-we-have-the-time"><a href="#installing-from-cd-if-we-have-the-time"><span class="header-section-number">6</span> Installing from CD (if we have the time)</a></h1>
340<h2 id="installing-support-packages"><a href="#installing-support-packages"><span class="header-section-number">6.1</span> Installing support packages</a></h2>
341<p>We need to install a support package called <code>ganeti-instance-image</code>, which will allow us to install an operating system, just like we did with VirtualBox and KVM, that is:</p>
342<ul>
343<li>create machine with disk(s), network cards</li>
344<li>attach a CD image</li>
345<li>boot the machine and view the console</li>
346</ul>
347<p>The package can be installed as follows <sup><a href="#fn4" class="footnoteRef" id="fnref4">4</a></sup>:</p>
348<pre><code>wget https://code.osuosl.org/attachments/download/2169/ganeti-instance-image_0.5.1-1_all.deb
349dpkg -i ganeti-instance-image_0.5.1-1_all.deb</code></pre>
350<h2 id="distributing-iso-images"><a href="#distributing-iso-images"><span class="header-section-number">6.2</span> Distributing ISO images</a></h2>
351<p>If using DRBD, the ISO images used for CD installs must be present on all nodes in the cluster, in the same path.</p>
352<p>Copy from your USB key the antix Linux distribution ISO, found under the iso directory, to <code>/home/nsrc</code>, on the master node.</p>
353<p>It should be called <code>antiX-13.2_386-full.iso</code>.</p>
354<p>We can use the <code>gnt-cluster copyfile</code> we learned about earlier, to distribute the ISO image to all nodes:</p>
355<pre><code>$ sudo gnt-cluster copyfile /home/nsrc/antiX-13.2_386-full.iso</code></pre>
356<p>That should copy the file over to all the other nodes.</p>
357<p>From here, we have to decide whether we want to create an LVM (plain) instance, or a redundant DRBD instance:</p>
358<h2 id="if-creating-an-instance-using-plain-lvm-based-disks-cd-install"><a href="#if-creating-an-instance-using-plain-lvm-based-disks-cd-install"><span class="header-section-number">6.3</span> If creating an instance using 'plain' (LVM) based disks, CD install</a></h2>
359<p>gnt-instance add -t plain -o image+default<br /> -s 3GB -B memory=128M<br /> -n vmX.ws.nsrc.org<br /> --no-install --no-start --no-ip-check --no-name-check<br /> -H kvm:vnc_bind_address=0.0.0.0,boot_order=cdrom,cdrom_image_path=/home/nsrc/antiX-13.2_386-full.iso<br /> antix-plain</p>
360<p>... you will see some messages about creating the instance being created.</p>
361<h2 id="if-creating-and-instance-with-drbd-disks-cd-install"><a href="#if-creating-and-instance-with-drbd-disks-cd-install"><span class="header-section-number">6.4</span> If creating and instance with DRBD disks, CD install</a></h2>
362<p>gnt-instance add -t drbd -o image+default<br /> -s 3GB -B memory=128M<br /> -n vmX.ws.nsrc.org:vmY.ws.nsrc.org<br /> --no-install --no-start --no-ip-check --no-name-check<br /> -H kvm:vnc_bind_address=0.0.0.0,boot_order=cdrom,cdrom_image_path=/home/nsrc/antiX-13.2_386-full.iso<br /> antix-drbd</p>
363<pre><code>Tue Jan 14 05:40:34 2014 * disk 0, size 1.0G
364Tue Jan 14 05:40:34 2014 * creating instance disks...
365Tue Jan 14 05:40:34 2014 adding instance antix to cluster config
366Tue Jan 14 05:40:34 2014  - INFO: Waiting for instance antix to sync disks
367Tue Jan 14 05:40:35 2014  - INFO: Instance antix's disks are in sync</code></pre>
368<p>Regardless of whether you created a plain or drbd (or both!), check using <code>gnt-instance list</code> to see that the instance was created properly:</p>
369<pre><code>$ sudo gnt-instance list
370
371Instance      Hypervisor OS            Primary_node Status     Memory
372antix-plain   kvm        image+default vm1          ADMIN_down      -</code></pre>
373<p>Start the VM</p>
374<pre><code>$ sudo gnt-instance start antix-plain   # if it's called antix-drbd, use that
375
376Waiting for job 125 for antix ...</code></pre>
377<p>Check that your VM is running:</p>
378<pre><code># gnt-instance list -o name,pnode,snodes,oper_ram,nic.bridge/0,network_port,nic.link/0,sda_size,status</code></pre>
379<p>Look for the port number under Network_port, then open a VNC viewer and point it at the port listed, on the Host mentioned as pnode. Remember that we have set a console password.</p>
380<p>Install the OS following the instructions.</p>
381<p>When done, and the installer says you can, shut down the instance:</p>
382<pre><code># gnt-instance shutdown --timeout=0 antix-plain</code></pre>
383<p>Note that --timeout=0 is a &quot;rough&quot; way of shutting down. Only do this if you have problems (the VM doesn't answer) or if you are certain the VM is finished running (sometimes the VM doesn't properly shut down the virtual hardware using ACPI).</p>
384<p>If you want to shut down the instance properly, you can always issue:</p>
385<pre><code># gnt-instance shutdown antix-plain</code></pre>
386<p>This will send ACPI shutdown request (similar to pressing the power button on a modern PC).</p>
387<p>Now modify the instance to boot on the disk. We leave the CD image in the virtual cdrom drive:</p>
388<pre><code># gnt-instance modify -H boot_order=disk,cdrom_image_path=&quot;&quot;,kernel_path=&quot;&quot; \
389    antix-plain</code></pre>
390<p>You can now restart the instance with <code>gnt-instace start antix-plain</code> (or whatever you named it)</p>
391<h2 id="changing-networks"><a href="#changing-networks"><span class="header-section-number">6.5</span> Changing networks</a></h2>
392<p>You don't have to run this, but if you want to you can.</p>
393<p>Moving the network interface 0 to another network:</p>
394<pre><code># gnt-instance modify --net 0:modify,link=br-lan INSTANCE_NAME</code></pre>
395<p>Try to do this to move the network interface of one of the instances you created earlier, onto the br-lan.</p>
396<p>You'll need to reboot the instance after you made the change:</p>
397<pre><code># gnt-instance reboot INSTANCE_NAME</code></pre>
398<p>You'll have to get into the VM's VNC console (since it won't be reachable over the network), and then you can run <code>dhclient eth0</code> to see if you can get an IP on the <code>br-lan</code> network.</p>
399<div class="footnotes">
400<hr />
401<ol>
402<li id="fn1"><p>If you are curious: <code>ls -l /var/cache/ganeti-instance-debootstrap/</code><a href="#fnref1">↩</a></p></li>
403<li id="fn2"><p>Reminder: <code>gnt-instance list -o name,pnode,network_port</code> then connect with VNC to the host &amp; port listed <sub>~</sub><a href="#fnref2">↩</a></p></li>
404<li id="fn3"><p>Note: would it not have been possible to add <code>openssh-server</code> to the <code>EXTRA_PKGS</code> section of the Ganeti debootstrap earlier ? Then we wouldn't need to install openssh manually on every instance we create.<a href="#fnref3">↩</a></p></li>
405<li id="fn4"><p>You could, as an alternative, fetch and build the newest version of <code>ganeti-instance-image</code>, from here (building instructions are included) http://ftp.osuosl.org/pub/osl/ganeti-instance-image/<a href="#fnref4">↩</a></p></li>
406</ol>
407</div>
408</body>
409</html>