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 create instances, generate snapshots and create mirror operations from ISO based on openstack kilo platform and KVM virtualization

2025-01-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces how to create instances from ISO, generate snapshots from instances, and create mirror operations based on openstack kilo platform and KVM virtualization. It has certain reference value. Interested friends can refer to it. I hope you will have a lot of gains after reading this article. Let's take a look at it together.

ISO Create Instance

There are two key configurations for creating instances from ISO: cloud host type flavor and ISO mirror parameters.

Cloud host type: openstack When creating a VM instance using ISO image, the root disk (Disk) in the selected cloud host type flavor is set to cdrom as the ISO boot optical drive device for OS installation source; temporary disk (OS-FLV-EXT-DATA:ephemeral) is used as the system disk of the VM instance as the installation target. Therefore, when configuring the cloud host type flavor for ISO startup, you need to set the root disk value, which can be slightly about ISO image file, 5G/10G, and can be configured according to the field; temporary disk is used as the startup disk of the system, and the size needs to be set according to business needs, generally more than 100G.

ISO mirror parameters: ISO mirror parameters are set according to virtualization types such as kvm/vsphere/xen. For specific parameters, please refer to http://docs.openstack.org/cli-reference/content/chapter_cli-glance-property.html. For centos6.7 operating system, KVM virtualization, you need to set the attributes os_distro, os_version, hw_boot_menu, the specific setting command glance image-update, please use the glance help image-update to view

After correctly setting the cloud host type and ISO image attributes, the virtual machine can be started normally and the installation of the operating system can be completed. For windows operating system, the default does not recognize the disk, you need to load and install the corresponding virtio driver, specific OS version please google it.

ISO VM instance generation qcow2 snapshot

The key issue with qcow2 generated from an iso VM instance is the order of OS boot sources that need to be resolved for the VM. At present, there is no configuration option for opening BIOS on kvm virtualization (it may also be that the author has not found the entrance, if you have to inform the author, thank you), the first boot option of virtual machine is to boot from CD/DVD. So in order to solve the boot order of virtual machines, we need to reject cdrom, which can be done as follows:

Use virsh attach-disk empty device, eject cdrom

Find the physical host where the VM needs to be snapped and execute the following command to find the VM ID

#virsh list

Find the ID of the corresponding virtual machine. Execute the following command to eject cdrom

#virsh attach-disk --type cdrom --mode readonly 35 "" hda --live

35 is the virtual machine ID, which can be queried through virsh list. At this point, you can perform reboot in the virtual machine to restart the virtual machine verification, you can find that the virtual machine will directly boot the OS

Generate virtual machine snapshots of centos

Centos snapshot generation is mainly used as a mirror template to quickly start the virtual machine, save the time-consuming operation of installing the operating system and automatically complete the configuration. From the practical point of view, it is mainly necessary to solve the problem of increasing the name of the network card device, for example, the newly generated virtual machine network card fails to start, the network card name changes to eth2, etc. This can be done by:

a. Delete specific coefficients about NIC/etc/sysconfig/network-scripts/ifcfg-eth0, such as MAC parameters and UUID. It is recommended to keep only the following parameters:

DEVICE=eth0

TYPE=Ethernet

ONBOOT=yes

BOOTPROTO=dhcp

NM_CONTROLLED=yes

b. Delete/etc/udev/70-persistent-net.rules to avoid incrementing the NIC name number of the virtual machine generated by mirroring to eth2.

Virtual machine snapshots for ubuntu operating system are recommended to refer to centos requirements for adaptation modifications.

Windows operating system virtual machine snapshot is mainly configured firewall and enable remote desktop services, and allow remote access.

Thank you for reading this article carefully. I hope that Xiaobian will share the article "How to create instances from ISO, generate snapshots from instances, and create mirror operations based on openstack kilo platform and KVM virtualization". This article is helpful to everyone. At the same time, I hope you will support it a lot. Pay attention to the industry information channel. More relevant knowledge is waiting for you to learn!

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