Merge "Rephrase of sentence:Virtual Machine Image Guide"
This commit is contained in:
commit
1e9d2929ef
@ -10,30 +10,27 @@
|
|||||||
creation.</para>
|
creation.</para>
|
||||||
<section xml:id="oz">
|
<section xml:id="oz">
|
||||||
<title>Oz</title>
|
<title>Oz</title>
|
||||||
<para><link
|
<para><link xlink:href="https://github.com/clalancette/oz/wiki"
|
||||||
xlink:href="https://github.com/clalancette/oz/wiki"
|
>Oz</link> is a command-line tool that automates the process of
|
||||||
>Oz</link> is a command-line tool that automates the
|
creating a virtual machine image file. Oz is a Python app that
|
||||||
process of creating a virtual machine image file. Oz is a
|
interacts with KVM to step through the process of installing a
|
||||||
Python app that interacts with KVM to step through the
|
virtual machine. It uses a predefined set of kickstart (Red
|
||||||
process of installing a virtual machine. It uses a
|
Hat-based systems) and preseed files (Debian-based systems) for
|
||||||
predefined set of kickstart (Red Hat-based systems) and
|
operating systems that it supports, and it can also be used to
|
||||||
preseed files (Debian-based systems) for operating systems
|
create Microsoft Windows images. On Fedora, install Oz with yum:<screen><prompt>#</prompt> <userinput>yum install oz</userinput></screen><note>
|
||||||
that it supports, and it can also be used to create
|
<para>As of this writing, there are no Oz packages for Ubuntu,
|
||||||
Microsoft Windows images. On Fedora, install Oz with yum:<screen><prompt>#</prompt> <userinput>yum install oz</userinput></screen><note>
|
so you will need to either install from source or build your
|
||||||
<para>As of this writing, there are no Oz packages for
|
own .deb file.</para>
|
||||||
Ubuntu, so you will need to either install from
|
|
||||||
source or build your own .deb file.</para>
|
|
||||||
</note></para>
|
</note></para>
|
||||||
<para>A full treatment of Oz is beyond the scope of this
|
<para>A full treatment of Oz is beyond the scope of this document, but
|
||||||
document, but we will provide an example. You can find
|
we will provide an example. You can find additional examples of Oz
|
||||||
additional examples of Oz template files on GitHub at
|
template files on GitHub at <link
|
||||||
<link
|
|
||||||
xlink:href="https://github.com/rackerjoe/oz-image-build/tree/master/templates"
|
xlink:href="https://github.com/rackerjoe/oz-image-build/tree/master/templates"
|
||||||
>rackerjoe/oz-image-build/templates</link>. Here's how
|
>rackerjoe/oz-image-build/templates</link>. Here's how you would
|
||||||
you would create a CentOS 6.4 image with Oz.</para>
|
create a CentOS 6.4 image with Oz.</para>
|
||||||
<para>Create a template file (we'll call it
|
<para>Create a template file (we'll call it
|
||||||
<filename>centos64.tdl</filename>) with the following
|
<filename>centos64.tdl</filename>) with the following contents.
|
||||||
contents. The only entry you will need to change is the
|
The only entry you will need to change is the
|
||||||
<literal><rootpw></literal>
|
<literal><rootpw></literal>
|
||||||
contents.<programlisting language="xml"><template>
|
contents.<programlisting language="xml"><template>
|
||||||
<name>centos64</name>
|
<name>centos64</name>
|
||||||
@ -68,53 +65,45 @@ echo -n > /lib/udev/rules.d/75-persistent-net-generator.rules
|
|||||||
</command>
|
</command>
|
||||||
</commands>
|
</commands>
|
||||||
</template></programlisting>
|
</template></programlisting>
|
||||||
</para>
|
</para>
|
||||||
<para>This Oz template specifies where to download the Centos
|
<para>This Oz template specifies where to download the Centos 6.4
|
||||||
6.4 install ISO. Oz will use the version information to
|
install ISO. Oz will use the version information to identify which
|
||||||
identify which kickstart file to use. In this case, it
|
kickstart file to use. In this case, it will be <link
|
||||||
will be <link
|
|
||||||
xlink:href="https://github.com/clalancette/oz/blob/master/oz/auto/RHEL6.auto"
|
xlink:href="https://github.com/clalancette/oz/blob/master/oz/auto/RHEL6.auto"
|
||||||
>RHEL6.auto</link>. It adds EPEL as a repository and
|
>RHEL6.auto</link>. It adds EPEL as a repository and install the
|
||||||
installs the <literal>epel-release</literal>,
|
<literal>epel-release</literal>, <literal>cloud-utils</literal>,
|
||||||
<literal>cloud-utils</literal>, and
|
and <literal>cloud-init</literal> packages, as specified in the
|
||||||
<literal>cloud-init</literal> packages, as specified
|
<literal>packages</literal> section of the file.</para>
|
||||||
in the <literal>packages</literal> section of the
|
<para>After Oz does the initial OS install using the kickstart file, it
|
||||||
file.</para>
|
updates the image's install packages with <command>yum
|
||||||
<para>After Oz does the initial OS install using the kickstart
|
update</command>. It also removes any reference to the eth0
|
||||||
file, it customizes the image by doing an update. It also
|
device that libvirt creates while Oz does the customizing, as
|
||||||
removes any reference to the eth0 device that libvirt
|
specified in the <literal>command</literal> section of the XML
|
||||||
creates while Oz does the customizing, as specified
|
|
||||||
in the <literal>command</literal> section of the XML
|
|
||||||
file.</para>
|
file.</para>
|
||||||
<para>To run this, do, as root:</para>
|
<para>To run this, do, as root:</para>
|
||||||
<para><screen><prompt>#</prompt> <userinput>oz-install -d3 -u centos64.tdl -x centos64-libvirt.xml</userinput></screen><itemizedlist>
|
<para><screen><prompt>#</prompt> <userinput>oz-install -d3 -u centos64.tdl -x centos64-libvirt.xml</userinput></screen><itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>The <literal>-d3</literal> flag tells Oz to
|
<para>The <literal>-d3</literal> flag tells Oz to show
|
||||||
show status information as it runs.</para>
|
status information as it runs.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>The <literal>-u</literal> tells Oz to do the
|
<para>The <literal>-u</literal> tells Oz to do the
|
||||||
customization (install extra packages, run the
|
customization (install extra packages, run the commands)
|
||||||
commands) once it does the initial
|
once it does the initial install.</para>
|
||||||
install.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>The <literal>-x <filename></literal> flag
|
<para>The <literal>-x <filename></literal> flag tells Oz
|
||||||
tells Oz what filename to use to write out a
|
what filename to use to write out a libvirt XML file
|
||||||
libvirt XML file (otherwise it will default to
|
(otherwise it will default to something like
|
||||||
something like
|
|
||||||
<filename>centos64Apr_03_2013-12:39:42</filename>).</para>
|
<filename>centos64Apr_03_2013-12:39:42</filename>).</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist>If you leave out the <literal>-u</literal>
|
</itemizedlist>If you leave out the <literal>-u</literal> flag, or
|
||||||
flag, or you want to edit the file to do additional
|
you want to edit the file to do additional customizations, you can
|
||||||
customizations, you can use the
|
use the <command>oz-customize</command> command, using the libvirt
|
||||||
<command>oz-customize</command> command, using the
|
XML file that <command>oz-install</command> creates. For example:
|
||||||
libvirt XML file that <command>oz-install</command>
|
|
||||||
creates. For example:
|
|
||||||
<screen><prompt>#</prompt> <userinput>oz-customize -d3 centos64.tdl centos64-libvirt.xml</userinput></screen>
|
<screen><prompt>#</prompt> <userinput>oz-customize -d3 centos64.tdl centos64-libvirt.xml</userinput></screen>
|
||||||
Oz will invoke libvirt to boot the image inside of KVM,
|
Oz will invoke libvirt to boot the image inside of KVM, then Oz will
|
||||||
then Oz will ssh into the instance and perform the
|
ssh into the instance and perform the customizations.</para>
|
||||||
customizations.</para>
|
|
||||||
</section>
|
</section>
|
||||||
<section xml:id="vmbuilder">
|
<section xml:id="vmbuilder">
|
||||||
<title>VMBuilder</title>
|
<title>VMBuilder</title>
|
||||||
|
Loading…
Reference in New Issue
Block a user