Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to make OpenStack Windows Image

2025-04-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article shows you how to make an OpenStack Windows image, the content is concise and easy to understand, it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

OpenStack deploys instance through the Glance image, which we discuss in detail today with windows2008 as an example.

The steps for making an image are as follows:

1. Create and run a windows2008 KVM virtual machine

two。 Install the virtio driver

3. Install cloudbase-init

4. Other customized work

5. Create a Glance image

6. Deploy a new instance through an image

1. Create and run a Windows2008 KVM virtual machine

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

First, create a 20g virtual disk as the boot disk of the virtual machine:

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

Copy virtual machine template

Cp template.xml win2008r2sp1.xml

Template.xml, how to get this template? In fact, it is very simple, usually directly dump the xml definition of the existing kvm virtual machine. For example:

Virsh dumpxml [vm-id] > template.xml

Modify the following items in win2008r2sp1.xml:

Virtual machine name

Virtual disk (previously created through qemu-img) and launch ISO

Create a virtual machine

Virsh define win2008r2sp1.xml

Start the virtual machine

Virsh start win2008r2sp1

Connect the virtual machine through vnc

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

Install the operating system through the wizard, and the process will not be repeated. If the virtual machine does not restart automatically during installation, you can start the virtual machine with the following command

Virsh start win2008r2sp1

After successful installation, set the IP address

two。 Install the virtio driver

OpenStack uses virtio disks and network cards by default, and virtio has good performance. Since windows does not have its own virtio driver, it needs to be installed manually, as follows:

Add a disk of type virtio.

Virsh edit win2008r2sp1

Modify the current network card device to virtio.

Restart the operating system and install the drivers for virtio.

The download address of virtio driver is https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso

3. Install cloudbase-init

Cloudbase-init enables instance deployed by windows images to automatically configure personalized information such as IP addresses. It works the same as linux's cloud-init, and the following demonstrates how to configure cloudbase-init.

Download cloudbase-init

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

Install cloudbase-init in the virtual machine

Cloudbase-init installer can be uploaded and installed from remote desktop

The system shuts down automatically.

4. Other customized work

Restart the virtual machine and complete other customization tasks, such as installing some common software as needed. At this point, the windows image file is ready and the file path is

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

5. Create a Glance image

The image creation method is the same as the linux image in the previous section

Glance image-create-name "Windows 2008 R2 SP1" >

6. Deploy a new instance through an image

Click the "start the CVM" button behind the image.

Name instance and click "run", and instance is created successfully and assigned to IP.

Click the instance name.

Open console.

You can see that instance starts normally in the VNC console.

Click the Administrator user

The password needs to be changed the first time you log in.

The above content is how to make an OpenStack Windows image. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report