Files
doc-exports/docs/bms/image-creation-guide/en-us_topic_0218670457.html
guoyanyan fe8c0cf45c BMS Image Creation Guide 1109
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: guoyanyan <guoyanyan3@huawei.com>
Co-committed-by: guoyanyan <guoyanyan3@huawei.com>
2022-11-16 08:53:42 +00:00

129 lines
29 KiB
HTML

<a name="EN-US_TOPIC_0218670457"></a><a name="EN-US_TOPIC_0218670457"></a>
<h1 class="topictitle1">SUSE/Red Hat/CentOS/Oracle Linux/Ubuntu/Debian</h1>
<div id="body1578617693350"><p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p38839175101531">You can install Cloud-Init in either of the following ways: <a href="#EN-US_TOPIC_0218670457__en-us_topic_0217827710_section9013470154018">(Recommended) Install Cloud-Init Using the Official Installation Package</a> and <a href="#EN-US_TOPIC_0218670457__en-us_topic_0217827710_section124220553610">Install Cloud-Init Using the Official Source Code Package and pip</a>.</p>
<div class="section" id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_section9013470154018"><a name="EN-US_TOPIC_0218670457__en-us_topic_0217827710_section9013470154018"></a><a name="en-us_topic_0217827710_section9013470154018"></a><h4 class="sectiontitle">(Recommended) Install Cloud-Init Using the Official Installation Package</h4><p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p23161163154018">The method of installing Cloud-Init on a VM varies depending on the OS. Perform the installation operations as user <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b10986123714236">root</strong>.</p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p25922872154018">The following describes how to install Cloud-Init on VMs running SUSE, CentOS, Debian, and Ubuntu. For other OS types, install the required type of Cloud-Init. For example, you need to install coreos-cloudinit on VMs running CoreOS.</p>
<ul id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_ul34101545154018"><li id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li257718382289">SUSE Linux<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p16577153872816"><a name="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li257718382289"></a><a name="en-us_topic_0217827710_li257718382289"></a>Paths for obtaining the Cloud-Init installation package for SUSE Linux</p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p45771138122815"><a href="http://ftp5.gwdg.de/pub/opensuse/repositories/Cloud:/Tools" target="_blank" rel="noopener noreferrer">http://ftp5.gwdg.de/pub/opensuse/repositories/Cloud:/Tools/</a></p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p8577153892819"><a href="http://download.opensuse.org/repositories/Cloud:/Tools/" target="_blank" rel="noopener noreferrer">http://download.opensuse.org/repositories/Cloud:/Tools/</a></p>
<div class="note" id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_note25778380285"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p18577103816287">Select the required repo installation package in the provided paths.</p>
</div></div>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p7577133802820">Take SUSE Enterprise Linux Server 12 as an example. Perform the following steps to install Cloud-Init:</p>
<ol id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_ol1257713810283"><li id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li16577183815282">Run the following command to install the network installation source for SUSE Enterprise Linux Server 12:<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p9577183892810"><a name="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li16577183815282"></a><a name="en-us_topic_0217827710_li16577183815282"></a><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b25778384288">zypper ar http://ftp5.gwdg.de/pub/opensuse/repositories/Cloud:/Tools/SLE_12_SP3/Cloud:Tools.repo</strong></p>
</li><li id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li155771238162817">Run the following command to update the network installation source:<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p15577133882813"><a name="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li155771238162817"></a><a name="en-us_topic_0217827710_li155771238162817"></a><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b1057723842812">zypper refresh</strong></p>
</li><li id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li12577173819285">Run the following command to install Cloud-Init:<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p115771338202814"><a name="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li12577173819285"></a><a name="en-us_topic_0217827710_li12577173819285"></a><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b25771138202819">zypper install cloud-init</strong></p>
</li><li id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li3577138172814">Run the following commands to enable Cloud-Init to automatically start upon system boot:<ul id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_ul155771138182819"><li id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li357715382282">SUSE 11<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p357713818281"><a name="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li357715382282"></a><a name="en-us_topic_0217827710_li357715382282"></a><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b1257763812813">chkconfig cloud-init-local on; chkconfig cloud-init on; chkconfig cloud-config on; chkconfig cloud-final on</strong></p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p964434018258"><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b12577153813285">service cloud-init-local status; service cloud-init status; service cloud-config status; service cloud-final status</strong></p>
</li><li id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li1689615470254">SUSE 12 and openSUSE 12/13/42<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p757733882812"><a name="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li1689615470254"></a><a name="en-us_topic_0217827710_li1689615470254"></a><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b155774383282">systemctl enable cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service</strong></p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p42322058162511"><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b9577938102814">systemctl status cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service</strong></p>
</li></ul>
<div class="notice" id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_note12577113811284"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p12577153842816">For SUSE and openSUSE, perform the following steps to disable dynamic change of the VM name:</p>
<ol type="a" id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_ol16577938102811"><li id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li757733819282">Run the following command to open the <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b48609206341817">dhcp</strong> file using the vi editor:<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p125771738122815"><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b98695268219">vi</strong> <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b178706261626">etc/sysconfig/network/dhcp</strong></p>
</li><li id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li1757793819284">Change the value of <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b842352706144152">DHCLIENT_SET_HOSTNAME</strong> in the <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b84235270614421">dhcp</strong> file to <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b842352706144213">no</strong>.</li></ol>
</div></div>
</li></ol>
</li><li id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li759323819284">CentOS<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p14577203816289"><a name="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li759323819284"></a><a name="en-us_topic_0217827710_li759323819284"></a><a href="#EN-US_TOPIC_0218670457__en-us_topic_0217827710_table859383892814">Table 1</a> lists the Cloud-Init installation paths for CentOS. Select an address from the following table and download the EPEL release package.</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0218670457__en-us_topic_0217827710_table859383892814"></a><a name="en-us_topic_0217827710_table859383892814"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_table859383892814" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Cloud-Init installation package addresses</caption><thead align="left"><tr id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_row135773383280"><th align="left" class="cellrowborder" valign="top" width="14.540000000000001%" id="mcps1.3.2.4.2.2.2.4.1.1"><p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p185771338112811">OS Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.05%" id="mcps1.3.2.4.2.2.2.4.1.2"><p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p3577938132810">Version</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="68.41000000000001%" id="mcps1.3.2.4.2.2.2.4.1.3"><p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p18577113811282">How to Obtain</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_row1759320380286"><td class="cellrowborder" rowspan="3" valign="top" width="14.540000000000001%" headers="mcps1.3.2.4.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p2593238202813">CentOS</p>
</td>
<td class="cellrowborder" valign="top" width="17.05%" headers="mcps1.3.2.4.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p8593163882820">6 32-bit</p>
</td>
<td class="cellrowborder" valign="top" width="68.41000000000001%" headers="mcps1.3.2.4.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p2059312384284"><a href="https://archives.fedoraproject.org/pub/archive/epel/6/i386/Packages/e/" target="_blank" rel="noopener noreferrer">https://archives.fedoraproject.org/pub/archive/epel/6/i386/Packages/e/</a></p>
</td>
</tr>
<tr id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_row11593143822818"><td class="cellrowborder" valign="top" headers="mcps1.3.2.4.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p6593163810285">6 64-bit</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.2.4.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p8593143812281"><a href="https://archives.fedoraproject.org/pub/archive/epel/6/x86_64/Packages/e/" target="_blank" rel="noopener noreferrer">https://archives.fedoraproject.org/pub/archive/epel/6/x86_64/Packages/e/</a></p>
</td>
</tr>
<tr id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_row6298251089"><td class="cellrowborder" valign="top" headers="mcps1.3.2.4.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p5300851082">7 64-bit</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.2.4.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p6300153812"><a href="https://archives.fedoraproject.org/pub/epel/7/x86_64/Packages/e/" target="_blank" rel="noopener noreferrer">https://archives.fedoraproject.org/pub/epel/7/x86_64/Packages/e/</a></p>
</td>
</tr>
</tbody>
</table>
</div>
<p class="litext" id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p0593103812810">Run the following commands to install Cloud-Init on a VM running CentOS 6.5 64-bit (example):</p>
<p class="litext" id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p125930380289"><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b58117417910">yum install https://archives.fedoraproject.org/pub/archive/epel/6/x86_64/Packages/e/epel-release-</strong><em id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_i158141141797">xx-x</em><em id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_i19835193152715">x</em><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b1481194112917">.noarch.rpm</strong></p>
<p class="litext" id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p3871181113219"><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b8593738162819">yum install cloud-init</strong></p>
<div class="note" id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_note151514101766"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p215191011610"><em id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_i14428114020615">xx-xx</em> indicates the version of Extra Packages for Enterprise Linux (EPEL) release required by the OS.</p>
</div></div>
</li><li id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li18593123892814">Debian<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p659315381284"><a name="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li18593123892814"></a><a name="en-us_topic_0217827710_li18593123892814"></a>Before installing Cloud-Init, ensure that the network installation source address has been configured for the OS by checking whether the <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b842352706142953">/etc/apt/sources.list</strong> file contains the installation source address of the software package. If the file does not contain the address, configure the address by following the instructions on the Debian official website.</p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p65936383284">Run the following commands to install Cloud-Init:</p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p85930385284"><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b1759310388288">apt-get update</strong></p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p65931538202817"><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b488012119314">apt-get install</strong> <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b288115111835">cloud-init</strong></p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p8532444493">After Cloud-Init is installed in the Debian OS, run the following commands to install the vlan and ifenslave services:</p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p1134024671815"><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b111761444191818">apt-get install vlan</strong></p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p14758134716185"><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b8328155318189">apt-get install ifenslave</strong></p>
</li><li id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li591053412919">Ubuntu<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p1891112341196"><a name="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li591053412919"></a><a name="en-us_topic_0217827710_li591053412919"></a>Before installing Cloud-Init, ensure that the network installation source address has been configured for the OS by checking whether the <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b433522181313">/etc/apt/sources.list</strong> file contains the installation source address of the software package. If the file does not contain the address, configure the address by following the instructions on the Ubuntu official website.</p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p29114341892">Run the following commands to install Cloud-Init:</p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p99116343910"><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b6911203419917">apt-get update</strong></p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p491193411918"><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b09117348915">apt-get install</strong> <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b791118341293">cloud-init</strong></p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p75191233141016">After Cloud-Init is installed in the Ubuntu OS, perform the following operations to install tools and services:</p>
<ol id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_ol2747345191313"><li id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li135181915461">Install the SSH service.<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p284433674715"><a name="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li135181915461"></a><a name="en-us_topic_0217827710_li135181915461"></a>For x86, run the following commands:</p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p1636117344479"><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b49131849124711">apt-get install openssh-client</strong></p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p9361434194716"><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b99153492471">apt-get install openssh-server</strong></p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p133621534114716">For ARM64, run the following commands:</p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p103621834134712"><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b1547855324713">apt install openssh-client</strong></p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p193627345476"><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b1147914533479">apt install openssh-server</strong></p>
</li><li id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li14115171716468">Install dkms.<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p520215560519"><a name="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li14115171716468"></a><a name="en-us_topic_0217827710_li14115171716468"></a>To ensure that SDI drivers can run properly, you need to install dkms for Ubuntu.</p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p325164112174">Run the following command to install the tool:</p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p16805133445218"><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b79141931191712">apt-get install dkms</strong></p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p1048313771912">Then, run the following command:</p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p1980513475218"><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b1767618466184">vi /usr/sbin/dkms</strong></p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p12805183485220">Go to line 283 (press <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b222417544198">shift</strong> and <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b9732155616194">:</strong> to enter the CLI mode. Then, type <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b17512147162011">283</strong> and press <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b183667100207">Enter</strong>) and modify this line as follows:</p>
<pre class="screen" id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_screen5592191114536">invoke_command "$mkinitrd -f $initrd_dir/$initrd $1" "$mkinitrd" background</pre>
</li><li id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li11715454141312">Install the vlan and ifenslave services.<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p153317277562"><a name="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li11715454141312"></a><a name="en-us_topic_0217827710_li11715454141312"></a><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b1233119279564">apt-get install vlan</strong></p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p1933122795611"><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b4331427175612">apt-get install ifenslave</strong></p>
</li><li id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li15171185491319">Install the ifupdown service.<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p544793315151"><a name="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li15171185491319"></a><a name="en-us_topic_0217827710_li15171185491319"></a><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b1934843520158">apt-get install ifupdown</strong></p>
</li></ol>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_section124220553610"><a name="EN-US_TOPIC_0218670457__en-us_topic_0217827710_section124220553610"></a><a name="en-us_topic_0217827710_section124220553610"></a><h4 class="sectiontitle">Install Cloud-Init Using the Official Source Code Package and pip</h4><p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p29746854154018">The following operations use Cloud-Init 0.7.9 as an example to describe how to install Cloud-Init.</p>
<ol id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_ol66395096154018"><li id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li60684953154018">Download the <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b84235270610053">cloud-init-0.7.9.tar.gz</strong> source code package (version 0.7.9 is recommended) and upload it to the <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b84235270610135">/home/</strong> directory of the VM.<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p9293666154018">Download <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b6387899212217">cloud-init-0.7.9.tar.gz</strong> from the following path:</p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p16534132154018"><a href="https://launchpad.net/cloud-init/trunk/0.7.9/+download/cloud-init-0.7.9.tar.gz" target="_blank" rel="noopener noreferrer">https://launchpad.net/cloud-init/trunk/0.7.9/+download/cloud-init-0.7.9.tar.gz</a></p>
</li><li id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li64196320154018">Create a <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b54500370241817">pip.conf</strong> file in the <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b159147856041817">~/.pip/</strong> directory and edit the following content:<div class="note" id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_note40895972154018"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p32519428154018">If the <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b144022920241817">~/.pip/</strong> directory does not exist, run the <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b53657985441817">mkdir ~/.pip</strong> command to create it.</p>
</div></div>
<pre class="screen" id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_screen1423114515284">[global]
index-url = https://<strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b920099132915">&lt;$mirror&gt;</strong>/simple/
trusted-host = <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b15279149293">&lt;$mirror&gt;</strong></pre>
<div class="note" id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_note20412346124814"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p16428154613483">Replace <em id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_i80788045541817">&lt;$mirror&gt;</em> with a public network PyPI source.</p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p21311810499">Public network PyPI source: <a href="https://pypi.python.org/" target="_blank" rel="noopener noreferrer">https://pypi.python.org/</a></p>
</div></div>
</li><li id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li60603354154018">Run the following command to install the downloaded Cloud-Init source code package (select <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b513074562913">--upgrade</strong> as needed during installation):<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p8559275154018"><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b9924611154018">pip install [--upgrade] /home/cloud-init-0.7.9.tar.gz</strong></p>
</li><li id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li22212635154018">Run the <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b65695988154018">cloud-init -v</strong> command. Cloud-Init is installed successfully if the following information is displayed:<pre class="screen" id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_screen54392983154018">cloud-init 0.7.9</pre>
</li><li id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li43755528154018">Enable Cloud-Init to automatically start upon system boot.<ul id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_ul58255440154018"><li id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li54536918154018">If the OS uses SysVinit to manage automatic start of services, run the following commands:<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p21070219154018"><a name="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li54536918154018"></a><a name="en-us_topic_0217827710_li54536918154018"></a><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b55414248154018">chkconfig --add cloud-init-local; chkconfig --add cloud-init; chkconfig --add cloud-config; chkconfig --add cloud-final</strong></p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p28966191154018"><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b59369127154018">chkconfig cloud-init-local on; chkconfig cloud-init on; chkconfig cloud-config on; chkconfig cloud-final on</strong></p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p64560098154018"><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b44169978154018">service cloud-init-local status; service cloud-init status; service cloud-config status; service cloud-final status</strong></p>
</li><li id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li61985487154018">If the OS uses Systemd to manage automatic start of services, run the following commands:<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p20998474154018"><a name="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li61985487154018"></a><a name="en-us_topic_0217827710_li61985487154018"></a><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b54768540154018">systemctl enable cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service</strong></p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p23154814154018"><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b7066737154018">systemctl status cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service</strong></p>
</li></ul>
</li></ol>
<div class="notice" id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_note63600639154018"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p35534839154018">If you install Cloud-Init using the official source code package and pip, pay attention to the following:</p>
<ol id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_ol51378100154018"><li id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li59749717154018">Add user <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b842352706145831">syslog</strong> to the <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b842352706145847">adm</strong> group during the installation. If user <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b199409414941817">syslog</strong> exists, add it to the <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b38734556241817">adm</strong> group. For some OSs (such as CentOS and SUSE), user <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b37457222541817">syslog</strong> may not exist. Run the following commands to create user <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b148615865441817">syslog</strong> and add it to the <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b106714574941817">adm</strong> group:<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p876549154018"><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b7888948154018">useradd syslog</strong></p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p3891676154018"><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b35025084154018">groupadd adm</strong></p>
<p id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_p1683214773418"><strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b03142113913">usermod -g adm syslog</strong></p>
</li><li id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_li46790302154018">Change the value of <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b91779428641817">distro</strong> in <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b123687611941817">system_info</strong> in the <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b16378241341817">/etc/cloud/cloud.cfg</strong> file based on the OS release version, such as <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b212184884541817">distro: ubuntu</strong>, <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b180709406541817">distro: sles</strong>, <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b180079733141817">distro: debian</strong>, and <strong id="EN-US_TOPIC_0218670457__en-us_topic_0217827710_b205518784341817">distro: fedora</strong>.</li></ol>
</div></div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0100489884.html">Installing Cloud-Init</a></div>
</div>
</div>