Make OpenStack Windows mirroring-5 minutes a day to play with OpenStack (152)

Source: Internet
Author: User

This is the 2nd chapter in the OpenStack implementation experience sharing series.


OpenStack deploys instance through Glance mirroring, the previous section introduces the Linux image authoring method, Windows mirroring is very different from Linux, and today we take windows2008 as an example to discuss it in detail.


The image production steps are as follows:
1. Create and run the windows2008 KVM virtual machine
2. Installing the Virtio Drive
3. Installing Cloudbase-init
4. Other Custom work
5. Create a Glance image
6. Deploying new instance through mirroring

1. Create and run the Windows2008 KVM virtual machine

If there is a virt-manager, this step can be done in the graphical interface. Considering that not all cases have virt-manager, we are here to operate directly on the KVM host. The following steps are used to create a windows2008 virtual machine.


First create a 20G virtual disk as the Startup disk for the virtual machine:


Qemu-img create-f Qcow2/var/lib/libvirt/images/win2008r2sp1.qcow2 20G

650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250888175049316.png "/>

Copy Virtual machine template


CP Template.xml Win2008r2sp1.xml


Template.xml How does this template come from? In fact, it is simple to dump the XML definition of an existing KVM virtual machine directly. Like what:


Virsh dumpxml [Vm-id] > Template.xml


Modify the following items in the Win2008r2sp1.xml:


Virtual machine Name


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250888287019734.png "/>


Virtual disks (previously created via QEMU-IMG) and boot ISO


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250888440038612.png "/>


Create a virtual machine


Virsh Define Win2008r2sp1.xml



650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250888655089078.png "/>


Start a virtual machine


Virsh Start WIN2008R2SP1


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250888734056545.png "/>


Connecting virtual machines via VNC


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250888816090412.png "/>


Here 172.17.12.11 is the host IP, the port number is 2 (can be queried through Virsh vncdisplay). After the connection is successful, the virtual machine installation interface is displayed


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250888950085020.jpg "/>

The process of installing the operating system through the wizard is no longer mentioned. If the virtual machine does not restart automatically during the installation process, you can start the virtual machine with the following command


Virsh Start WIN2008R2SP1


After the installation is successful, set the IP address


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250889098064337.png "/>

2. Installing the Virtio Drive

OpenStack uses Virtio disks and network cards by default, and Virtio performs well. Because Windows does not have its own Virtio driver, manual installation is required, as follows:


Add a virtio type of disk.


Virsh Edit Win2008r2sp1


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250889325085186.png "/>


Modify the current NIC device to Virtio.


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250889494090912.png "alt=" Image11.png "/>


Restart the operating system and install the Virtio driver.


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250889580022565.png "/>


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250889704062883.png "/>




650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250889819055980.png "/>


Virtio driver for Https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso.

650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250889899045282.png "/>


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250889978047514.png "/>

3. Installing Cloudbase-init

Cloudbase-init enables the instance of a Windows mirroring deployment to automatically configure personalization information such as IP addresses. As with the Linux Cloud-init, the following illustrates the Cloudbase-init configuration method.


Download Cloudbase-init


https://cloudbase.it/cloudbase-init/#download


Installing Cloudbase-init in a virtual machine


Cloudbase-init Installer can be uploaded via Remote Desktop and installed


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250890106088268.png "/>


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250890385072081.jpg "/>


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250890604012823.png "/>


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250890808045502.png "/>


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250890916078672.png "/>


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250891096069904.png "/>


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250891204030519.jpg "/>


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250891388017293.png "/>


The system will shut down automatically.

4. Other Custom work

Restart the virtual machine to complete other customizations, such as installing some common software as needed. Now that the Windows image file is ready, the file path is


/var/lib/libvirt/images/win2008r2sp1.qcow2

5. Create a Glance image

The image creation method is the same as the previous Linux image


glance image-create--name "Windows R2 SP1"--file/var/lib/libvirt/images/win2008r2sp1.qcow2--disk-format Qcow2--container-format bare--is-public true--progress


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250891493022383.png "/>

6. Deploying new instance through mirroring

650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250891582064945.png "/>


Click the "Start Cloud Host" button on the back of the image.


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250891728068723.png "/>


Give instance a name and click "Run", instance create successfully and assign to IP.


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250891918071273.png "/>


Click Instance Name.

650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250892014055838.png "/>


Open the console.


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250892188096286.png "/>

In the VNC console you can see that the instance starts normally.


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250892351011898.jpg "/>


Click Administrator User


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250892454084228.jpg "/>


The first login requires a password change.


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250892538060051.jpg "/>


The above is the operation of customizing OpenStack Windows mirroring, and the next section discusses some of the experience and techniques used in mirroring.


650) this.width=650; "Src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170216-1487250892631019677.jpg "/>

Make OpenStack Windows mirroring-5 minutes a day to play with OpenStack (152)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.