Track2Virt: ex-ganeti-instance-debootstrap.htm

File ex-ganeti-instance-debootstrap.htm, 38.5 KB (added by Brian Candler, 6 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 using instance-debootstrap</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 using instance-debootstrap</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="#configure-parameters-for-our-vm"><span class="toc-section-number">2.1.2</span> Configure parameters for our VM</a></li>
22<li><a href="#create-a-debian-instance"><span class="toc-section-number">2.1.3</span> Create a Debian instance</a></li>
23</ul></li>
24</ul></li>
25<li><a href="#network-configuration"><span class="toc-section-number">3</span> Network configuration</a></li>
26<li><a href="#extra-exercises"><span class="toc-section-number">4</span> Extra exercises</a><ul>
27<li><a href="#install-packages"><span class="toc-section-number">4.1</span> Install packages</a></li>
28<li><a href="#check-sources"><span class="toc-section-number">4.2</span> Check sources</a></li>
29<li><a href="#set-a-default-root-password-for-new-instances"><span class="toc-section-number">4.3</span> Set a default root password for new instances</a></li>
30<li><a href="#additional-hooks"><span class="toc-section-number">4.4</span> Additional hooks</a></li>
31<li><a href="#installing-ubuntu"><span class="toc-section-number">4.5</span> Installing Ubuntu</a></li>
32</ul></li>
33</ul>
34</div>
35<h1 id="objectives"><a href="#objectives"><span class="header-section-number">1</span> Objectives</a></h1>
36<ul>
37<li>Learn various ganeti commands</li>
38<li>Install a simple machine, automatically, on an LVM volume</li>
39</ul>
40<p>NOTE: all the commands in this exercise are run as the root user. If you are logged in as a regular user, use <code>sudo -s</code> to get a root shell.</p>
41<pre><code>$ sudo -s
42# </code></pre>
43<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>
44<p>Before we create and install VMs, we need to change default settings in the cluster (this should have been done before, but we're doing it to be safe).</p>
45<p>Do this on the MASTER node:</p>
46<pre><code># gnt-cluster modify -H kvm:kernel_path=,initrd_path=,vnc_bind_address=0.0.0.0</code></pre>
47<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>
48<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>
49<p>First, we need to adjust a few things.</p>
50<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>
51<p>There is an old version of the package &quot;ganeti-instance-debootstrap&quot; in Debian wheezy, but a newer one in wheezy-backports (version 0.14 at the time of writing). So check that you have the newer version:</p>
52<pre><code># apt-get install ganeti-instance-debootstrap/wheezy-backports</code></pre>
53<p>You will need to do this on all nodes in the cluster, because instances can be created on any node and you want them to be consistent.</p>
54<p>Test that the &quot;instance OS&quot; type is recognized: on the master node,</p>
55<pre><code># gnt-os list</code></pre>
56<p>This should show: <code>debootstrap+default</code>. If not, try <code>gnt-os diagnose</code> for more information.</p>
57<h3 id="configure-parameters-for-our-vm"><a href="#configure-parameters-for-our-vm"><span class="header-section-number">2.1.2</span> Configure parameters for our VM</a></h3>
58<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>
59<p>Have a look in the file <code>/etc/default/ganeti-instance-debootstrap</code>, which contains the default <code>debootstrap</code> settings for Ganeti.</p>
60<p>You can see various options that we covered before in the scripted installs:</p>
61<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>
62<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>
63<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>
64<p>Therefore:</p>
65<pre><code># editor /etc/ganeti/instance-debootstrap/variants/default.conf</code></pre>
66<p>And add the following lines:</p>
67<pre><code>ARCH=&quot;amd64&quot;
68EXTRA_PKGS=&quot;acpi-support-base,console-tools,udev,linux-image-amd64,sudo,vim,grub-pc,openssh-server&quot;
69PROXY=&quot;http://apt.virt.nsrc.org:3142/&quot;</code></pre>
70<p>Summary:</p>
71<ul>
72<li>We changed the architecture from i386 to amd64</li>
73<li>We enabled extra packages, including the boot loader (GRUB)</li>
74<li>We are using out local apt-cacher-ng proxy for downloading packages (which will be much faster than everyone in the class fetching them directly across the Internet)</li>
75</ul>
76<h3 id="create-a-debian-instance"><a href="#create-a-debian-instance"><span class="header-section-number">2.1.3</span> Create a Debian instance</a></h3>
77<blockquote>
78<p>As with the previous exercise: each pair of people can create a VM called <code>debianX</code> and place it on your node <code>nodeX</code>, but you will need to be logged into the MASTER node of your cluster to issue these commands</p>
79</blockquote>
80<pre><code># gnt-instance add -t plain -o debootstrap+default \
81    -s 4G -B minmem=256M,maxmem=512M -n nodeX.virt.nsrc.org \
82    --no-name-check --no-ip-check debianX</code></pre>
83<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>
84<p>It needs to fetch packages just like for debootstrap in the previous labs. Be patient...</p>
85<pre><code>Sat Jan 18 09:52:14 2014 * disk 0, size 4.0G
86Sat Jan 18 09:52:14 2014 * creating instance disks...
87Sat Jan 18 09:52:15 2014 adding instance debianX to cluster config
88Sat Jan 18 09:52:15 2014  - INFO: Waiting for instance debianX to sync disks
89Sat Jan 18 09:52:15 2014  - INFO: Instance debianX's disks are in sync
90Sat Jan 18 09:52:15 2014 * running the instance OS create scripts...
91Sat Jan 18 10:02:53 2014 * starting instance...</code></pre>
92<p>Ok, the build is done! The good thing is, in the future, Ganeti has cached the image on 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>
93<p>By default, the root password for your VM is the empty string.</p>
94<p>Unfortunately, there is currently a problem currently with this way of installing VMs on Ganeti.</p>
95<p>Your VM will not come up, and KVM will hang with 99% cpu:</p>
96<pre><code># top
97
98...
99  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND
100 5981 root      20   0  765m  11m 3144 S  98.8  1.1   6:05.41 kvm</code></pre>
101<p>If you attach a VNC console you will see it stuck at &quot;Booting from Hard Disk...&quot;. This is because the grub bootloader wasn't installed in the instance <sup><a href="#fn2" class="footnoteRef" id="fnref2">2</a></sup>.</p>
102<p>Let's fix it.</p>
103<p>Bring down the host (immediate shutdown):</p>
104<pre><code># gnt-instance shutdown --timeout=0 debianX
105Waiting for job 211 for debianX ...</code></pre>
106<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>
107<pre><code># gnt-instance start \
108    -H kernel_path=/vmlinuz,initrd_path=/initrd.img,kernel_args=&quot;ro single&quot; \
109    debianX</code></pre>
110<p>Wait a few seconds, then start a serial console:</p>
111<pre><code># gnt-instance console debianX</code></pre>
112<p>Press ENTER</p>
113<p>You should see:</p>
114<pre><code>Login incorrect.
115Give root password for maintenance
116(or type Control-D to continue):</code></pre>
117<p>Here, hit Enter. If all goes well, you are in:</p>
118<pre><code>root@debianX:~#</code></pre>
119<p>Now we can fix the GRUB bootloader on the VM:</p>
120<p>Note: you are typing this in the console, NOT ON YOUR HOST!</p>
121<p>Update the GRUB config and install the bootloader in the boot sector of our VM disk:</p>
122<pre><code># update-grub
123
124Generating grub.cfg ...
125cat: /boot/grub/video.lst: No such file or directory
126Found linux image: /boot/vmlinuz-3.2.0-4-amd64
127Found initrd image: /boot/initrd.img-3.2.0-4-amd64
128done
129
130# grub-install /dev/vda
131
132Installation finished. No error reported.</code></pre>
133<p>Exit the serial console by pressing <code>^]</code> (control + right square bracket)</p>
134<p>Back at the master node prompt, shutdown and restart the guest:</p>
135<pre><code># gnt-instance reboot --shutdown-timeout=30 debianX</code></pre>
136<p>Wait until the prompt returns. If all goes well, you should now be able to get a console on your instance, either using <code>gnt-instance console debianX</code> or using VNC <sup><a href="#fn3" class="footnoteRef" id="fnref3">3</a></sup></p>
137<h1 id="network-configuration"><a href="#network-configuration"><span class="header-section-number">3</span> Network configuration</a></h1>
138<p>Once you have a console on your VM, type the following:</p>
139<pre><code># ifconfig eth0</code></pre>
140<p>Does your VM have an IP address? If not, edit <code>/etc/network/interfaces</code> so that it looks like this:</p>
141<pre><code># This file describes the network interfaces available on your system
142# and how to activate them. For more information, see interfaces(5).
143
144auto lo
145iface lo inet loopback
146
147auto eth0
148iface eth0 inet dhcp</code></pre>
149<p>You can now bring up the interface:</p>
150<pre><code># ifup eth0</code></pre>
151<p>Once you have an IP address, test that network connectivity works, by pinging the class webserver:</p>
152<pre><code># ping -c5 www.virt.nsrc.org</code></pre>
153<p>You should also be able to use SSH to login to your guest from your laptop, with username <code>root</code> and the password you configured.</p>
154<p><strong>Congratulations! The remainder of this worksheet is extra information in case you finish early, or which you can review at your leisure later</strong></p>
155<h1 id="extra-exercises"><a href="#extra-exercises"><span class="header-section-number">4</span> Extra exercises</a></h1>
156<h2 id="install-packages"><a href="#install-packages"><span class="header-section-number">4.1</span> Install packages</a></h2>
157<p>Let's make sure we are using the in-class package cache:</p>
158<p>Edit or create the file <code>/etc/apt/apt.conf</code> and add this line:</p>
159<pre><code>Acquire::http::Proxy &quot;http://apt.virt.nsrc.org:3142/&quot;;</code></pre>
160<p>Now we can install, for example, the apache web server <sup><a href="#fn4" class="footnoteRef" id="fnref4">4</a></sup></p>
161<pre><code># apt-get install apache2</code></pre>
162<h2 id="check-sources"><a href="#check-sources"><span class="header-section-number">4.2</span> Check sources</a></h2>
163<p>Inside your VM, check the package sources which have been used:</p>
164<pre><code># cat /etc/apt/sources.list</code></pre>
165<p>If this is a single line, then you won't be getting any updated packages (including security fixes). So you should copy sources.list from another Debian machine, e.g. your virtualization host. And after this, bring the packages in your VM up to date:</p>
166<pre><code># apt-get update
167# apt-get dist-upgrade</code></pre>
168<p>Note: you don't really want to be creating fresh VMs with long-standing security holes, so this is something to beware of. For more information see <a href="https://groups.google.com/forum/#!topic/ganeti/-Shl7U51OFk">this discussion</a>. The solution is to use a hook to replace <code>sources.list</code> in the guest.</p>
169<h2 id="set-a-default-root-password-for-new-instances"><a href="#set-a-default-root-password-for-new-instances"><span class="header-section-number">4.3</span> Set a default root password for new instances</a></h2>
170<p>Ganeti provides some sample &quot;hooks&quot; you can use to customize the VMs you create.</p>
171<p>Normally you would do this once on the master node and then use <code>gnt-cluster copyfile</code> to copy the files to the other nodes, but for this exercise, you can each do it on your own node.</p>
172<p>Now, having instances with an empty root password is very insecure, so let's say we want to automatically set a root password of our choosing. To do this we need a small shell script, and a data file containing the desired password.</p>
173<p>First, we need to copy the script into the 'hooks' directory:</p>
174<pre><code># cd /etc/ganeti/instance-debootstrap/hooks
175# cp /usr/share/doc/ganeti-instance-debootstrap/examples/defaultpasswords .
176# chmod +x defaultpasswords</code></pre>
177<p>(Notice the &quot;.&quot; which means &quot;into the current directory&quot;)</p>
178<p>And now we need to give it a password file:</p>
179<pre><code># cd /etc/ganeti/instance-debootstrap/hooks
180# mkdir confdata
181# cd confdata
182# cp /usr/share/doc/ganeti-instance-debootstrap/examples/confdata/defaultpasswords .
183# chmod 600 defaultpasswords</code></pre>
184<p>Edit this file &quot;defaultpasswords&quot; and change the default password from <code>s3cr3t</code> to the password we use in class. This file should be just one line:</p>
185<pre><code>root:XXXXXX</code></pre>
186<p>where XXXXXX is the password.</p>
187<p>Now new instances will be created with the root password you have entered.</p>
188<h2 id="additional-hooks"><a href="#additional-hooks"><span class="header-section-number">4.4</span> Additional hooks</a></h2>
189<p>Here's another example of how to automatically customize your OS installation. Let's say we want to install <code>/etc/resolv.conf</code> with particular contents.</p>
190<p>Change to the hooks directory:</p>
191<pre><code># cd /etc/ganeti/instance-debootstrap/hooks</code></pre>
192<p>Create a new file in this directory called <code>resolv</code> with the following contents:</p>
193<pre><code>#!/bin/bash
194if [ ! -d &quot;$TARGET/etc&quot; ]; then
195  echo &quot;Missing target etc directory&quot;
196  exit 1
197fi
198
199cat &lt;&lt;EOS &gt;&quot;$TARGET/etc/resolv.conf&quot;
200nameserver 10.10.10.241
201search virt.nsrc.org
202EOS</code></pre>
203<p>Make it executable:</p>
204<pre><code># chmod +x resolv</code></pre>
205<p>Now the next time you install a debootstrap image, it should have this customization applied automatically.</p>
206<p>Another use of hooks is configuring network interfaces automatically. You can create a script <code>/etc/ganeti/instance-debootstrap/hooks/interfaces</code> like this:</p>
207<pre><code>#!/bin/bash
208
209if [ -z &quot;$TARGET&quot; -o ! -d &quot;$TARGET&quot; ]; then
210  echo &quot;Missing target directory&quot;
211  exit 1
212fi
213
214if [ ! -d &quot;$TARGET/etc/network&quot; ]; then
215  echo &quot;Missing target network directory&quot;
216  exit 1
217fi
218
219if [ -z &quot;$NIC_COUNT&quot; ]; then
220  echo &quot;Missing NIC COUNT&quot;
221  exit 1
222fi
223
224if [ -n &quot;$NIC_0_IP&quot; ]; then
225
226  cat &gt; $TARGET/etc/network/interfaces &lt;&lt;EOF
227# This file describes the network interfaces available on your system
228# and how to activate them. For more information, see interfaces(5).
229
230auto lo
231iface lo inet loopback
232
233auto eth0
234iface eth0 inet static
235        address         $NIC_0_IP
236        netmask         255.255.255.0
237        gateway         10.10.10.254
238        dns-nameservers 10.10.10.241
239        bridge_ports    eth0
240        bridge_stp      off
241        bridge_fd       0
242        bridge_maxwait  0
243EOF
244
245elif [ &quot;$NIC_COUNT&quot; -gt 0 ]; then
246
247  cat &gt; $TARGET/etc/network/interfaces &lt;&lt;EOF
248# This file describes the network interfaces available on your system
249# and how to activate them. For more information, see interfaces(5).
250
251auto lo
252iface lo inet loopback
253
254auto eth0
255iface eth0 inet dhcp
256EOF
257
258fi</code></pre>
259<p>Again it needs to be made executable. Now if you allocate a static IP address to your NIC at VM creation time it will be configured in the interfaces file; if you do not, then it will still be configured for DHCP.</p>
260<p>More information on the environment variables passed to this script can be found in <a href="http://docs.ganeti.org/ganeti/master/man/ganeti-os-interface.html">man ganeti-os-interface</a></p>
261<h2 id="installing-ubuntu"><a href="#installing-ubuntu"><span class="header-section-number">4.5</span> Installing Ubuntu</a></h2>
262<p>You can also create other Debian-derived OSes this way. Here is how to install Ubuntu 12.04 (&quot;precise&quot;)</p>
263<p>On the master node, create <code>/etc/ganeti/instance-debootstrap/variants/precise.conf</code></p>
264<pre><code>MIRROR=&quot;http://archive.ubuntu.com/ubuntu/&quot;
265PROXY=&quot;http://apt.virt.nsrc.org:3142/&quot;
266SUITE=&quot;precise&quot;
267EXTRA_PKGS=&quot;acpid,console-tools,udev,linux-image-virtual,openssh-server&quot;
268COMPONENTS=&quot;main,restricted,universe,multiverse&quot;
269ARCH=&quot;amd64&quot;</code></pre>
270<p>Update <code>/etc/ganeti/instance-debootstrap/variants.list</code> so it looks like this:</p>
271<pre><code>default
272precise</code></pre>
273<p>Distribute these files to the other nodes:</p>
274<pre><code># gnt-cluster copyfile /etc/ganeti/instance-debootstrap/variants/precise.conf
275# gnt-cluster copyfile /etc/ganeti/instance-debootstrap/variants.list
276# gnt-os list</code></pre>
277<p>Now you can create an instance of Ubuntu Precise using the same <code>gnt-instance add</code> command as before but with <code>-o debootstrap+precise</code> as the operating system selection.</p>
278<div class="footnotes">
279<hr />
280<ol>
281<li id="fn1"><p>If you are curious: <code>ls -l /var/cache/ganeti-instance-debootstrap/</code><a href="#fnref1"></a></p></li>
282<li id="fn2"><p>There is a hook for doing this, but it's broken. There is a modified version you can <a href="https://code.google.com/p/ganeti/issues/detail?id=549#c5">download</a> - it only works when creating plain (non-drbd) images, but you can convert them to drbd afterwards. This is likely to be fixed with the <a href="http://docs.ganeti.org/ganeti/2.12/html/design-os.html">OS installation redesign</a><a href="#fnref2"></a></p></li>
283<li id="fn3"><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="#fnref3"></a></p></li>
284<li id="fn4"><p>Note: for any package which you want present in <em>every</em> VM you build, you can add it to the <code>EXTRA_PKGS</code> section of the Ganeti debootstrap configuration. You can make different OS variants for different uses.<a href="#fnref4"></a></p></li>
285</ol>
286</div>
287</body>
288</html>