A VM instance is a virtual machine instance running on a host. A VM instance has its own IP address to access a public network and run application services. VM instances are core components of ZStack.
Define CPU and memory size for a VM instance. Before resources are allocated, ZStack will select the host that has these resources to act as a candidate host, and then use the candidate host to create a VM instance.
Determine which image can be used to create a VM instance.
Specify one or more networks for a VM instance. After you select an image, an available cluster has been assigned for the VM instance. Also, ZStack will provide available networks attached by the cluster.
Start a VM instance that is in the stopped state. Then, this VM instance will work normally. When you started a VM instance, the last host where the VM instance resides will be enabled by default.
Scenario | VM Start |
---|---|
The cluster where the VM instance resides only attaches one or more local storages. | The VM instance can only be started on the last host where the VM instance resides. |
The cluster where the VM instance resides only attaches one or more shared storages. Currently, multiple NFS or SharedBlock primary storages are supported. | The VM instance can be started on the available hosts attached by the primary storage. |
The cluster where the VM instance resides attaches different types of primary storages. Currently, a combination of 1 LocalStorage + 1 NFS, 1 LocalStorage + 1 SMP, or 1 LocalStorage + 1 SharedBlock are supported. |
|
Stop the VM instance that is in the running state. The VM instance will be stopped normally.
Reboot the VM instance that is in the running state. During rebooting, all configurations for the VM instance will be updated, including boot order, console mode, USB redirection, and session count control.
Power off the VM instance that is in the running state. That is, the VM instance will be forced to stop. Exercise caution. Performing this operation will put you at risk of losing data.
Pause the VM instance. The VM instance will continue to consume memories or resources, but will temporarily not schedule hypervisors. Notice that the VM instance can be either resumed to the running or deleted state.
Resume the VM instance that is in the paused state. Hence, the VM instance can continue to run normally.
Delete the VM instance. If the VM instance is running, the VM instance will be powered off and enters deleted state. If the VM instance is in other states or statuses, the VM instance will enter directly deleted state.
Restore the VM instance that is in the deleted state to the stopped state.
Expunge the VM instance that is in the deleted state. Afterwards, the VM instance will be expunged from ZStack, and the storage space actually occupied by the root volume will be released.
Mainly refer to the cold migration for root volumes or data volumes. Before cold migration, detach associated data volumes for the VM instance.
Local storages also support hot migration. Make sure that you enable this service globally. Notice that this operation is not supported by the Windows VM instance. Before hot migration, detach associated data volumes from the Windows VM instances.
To achieve real-time hot migration, mainly copy memories and registers related to CPU. To support migrations across clusters, both destination cluster and source cluster are only required to attach a network and a primary storage used by the VM instance. If these clusters are attached to multiple types of primary storages, detach volumes for the VM instance before migrations are performed.
When you use snapshots, you are not creating a copy of the virtual hard disk. But actually, you need to create a copy of the VM virtual disk. If the virtual disk is damaged, the snapshot will be invalid, which means that the snapshot cannot be used to recover the damaged disk. Notice that the snapshot cannot be used to solve disk failures. So, you will still encounter a single point of failure.
Using too many snapshots will influence the performance of a VM instance. For example, if the old snapshot runs on the VM instance with excessive overloads, this old snapshot will be increased in size, and then the performance of the VM instance will be definitely slowed down. Or, if you create a large number of snapshots, the performance of the VM instance will be also slowed down.
Reserving a snapshot of a VM instance for a long time is a common mistake. The snapshot will increase in size as the time goes by. Also. the snapshot files will also be changed, and are not stored on the source disk. Hence, restoring the snapshot will take a long time. Also, during restoring, the VM instance may be forced to stop.
Restore the VM instance to the current snapshot point. By doing so, the data related to the volume will be reverted to the snapshot point. Before restoring the snapshot, make sure that you back up the volume data of the VM instance.
Detach a VM batch snapshot to a single snapshot. Also, the group relationship between the VM instance and its related volume snapshots will be detached. Exercise caution. After detaching the relationship, you cannot restore snapshots in bulk.
Copy the root volume and data volumes for the VM instance. Based on the instance offering of the VM instance, a new VM instance will be cloned from and then have the identical operating system as the VM instance.
Create data volumes from the primary storage attached by a cluster where the VM instance resides.
Volumes can be created based on the volume image. If the volume image is attached to an ImageStore backup storage, you can create the volumes on a Ceph primary storage.
Resize data volumes as needed after the VM instance stops. Modifying capacities for the data volumes will take effect after the VM instance starts. Notice that data volumes can only be expanded on the Cloud.
Encapsulate a volume as an image. This image can be used to create more volumes. Also, volumes on a Ceph primary storage can be encapsulated as volume images on an ImageStore backup storage.
Choose maximumCdRomNum. Default value: 3. Options: 1 | 2 | 3.
, and setAfter you inject an SSH key into a VM instance, you can use the SSH key to log in to the VM instance without passwords via SSH.
ssh_pwauth
option under /etc/cloud/cloud.cfg to 1.rm -rf /var/lib/cloud/instances
, and then reboot the VM instance. Finally, the SSH Key will take effect.If resources on hosts are sufficient, the VM instance configured with NeverStop will never be stopped.
After you attach an ISO to the VM instance, set the boot order for the VM instance. The boot order can be used to restore or reinstall the operating system. Set the boot order by prioritizing CDROM. After the VM instance reboots, all settings will take effect. Notice that these settings can only take effect once. If you reboot the VM instance next time, the VM instance will be booted from a hard disk by default. When you create a VM instance for the first time and select an ISO image without setting the boot order, the operating system will be automatically booted from the ISO image.
Select the specified host from the available host list to start the VM instance, which is applied to shared storages. If the VM instance uses a local storage, the host where the root volume resides can be used to start the VM instance.
Restore the image template to the initial state against the stopped VM instance. By doing so, the data that are changed within the VM instance will be erased. To reimage the VM instance, back up volume data in advance.
Change the owner of the VM instance to another regular account.
Set the RDF mode under the VDI scenario. By default, the console of the VM instance is opened in RDF mode. The settings take effect immediately.
Mainly used for VDI. Specifically, the USB device that plugs in a client can be redirected to the VM instance. After you change the USB redirection, restart the VM instance before all settings take effect.
Before you enable the QGA option, make sure that you have installed and run qemu-guest-agent
on the VM instance. After the QGA option is enabled, the VM instance defaults to let you change its password online.
Enable the QGA option. Also, you must install and run qemu guest agent
on a Linux or Windows VM instance. Make sure that the user name that you entered is existed.
The console mode supports VNC, SPICE, and VNC+SPICE. Specifically, VNC lets you open the console of the VM instance via a browser, while SPICE allows you to open the console of the VM instance via an SPICE client. These three console modes are supported. The settings will take effect after the VM instance is rebooted.
Allocate VM instances in the affinity group to different hosts as much as possible. If no more hosts are available, the VM instances will be allocated randomly.
Strictly allocate VM instances in the affinity group to different hosts. If no more hosts are available, the allocation fails.
Limit the upstream bandwidth and downstream bandwidth of the VM volumes and networks. All settings will take effect without rebooting the VM instance. Underused QoS will probably lead to the abnormality of the VM instance.
#cloud-config users: - name: test shell: /bin/bash groups: users sudo: ['ALL=(ALL) NOPASSWD:ALL'] ssh-authorized-keys: - ssh-rsa AAAAB3NzaC1LXCJfjroD1lT root@10-0-0-18 bootcmd: - mkdir /tmp/temp write_files: - path: /tmp/ZStack_config content: | Hello,world! permissions: '0755' fqdn: Perf-test disable_root: false ssh_pwauth: yes chpasswd: list: | root:word expire: False runcmd: - echo ls -l / >/root/list.sh
echo ls -l /
command.#cloud-config write_files: - encoding: b64 content: NDI= path: C:\b64 permissions: '0644' - encoding: base64 content: NDI= path: C:\b64_1 permissions: '0644' - encoding: gzip content: !!binary | H4sIAGUfoFQC/zMxAgCIsCQyAgAAAA== path: C:\gzip permissions: '0644'
The script above creates b64, b64_1, and gzip files under C drive when the VM instance is started.
Change the platform of the VM instance. Options: Linux | Windows | WindowsVirtio | Other | Paravirtualization. Linux, WindowsVirtio, and Paravirtualization support Virtio drivers, while Windows and Other use devices simulated by QEMU. Restart the VM instance before all settings take effect.
Set the maximum number of sessions accessible to the VM instance under the VDI scenario. Default value: 1. Once you change the value, the settings will take effect after the VM instance is rebooted. The SPICE mode is supported.
Select available networks to attach to the VM instance from the available L3 network list.
Detach the NICs from the VM instance. If the VM instance does not have any NIC, the VM instance will fail to be started after it is stopped. Make sure that you attach at least one NIC to the VM instance.
Let you change the default network for the VM instance. Ensure that you restart the network service before all settings take effect.
Specify a MAC address when you create a VM instance. After you stop the VM instance, you can set or modify the MAC address.
Set a specified IP address for the VM instance. Select an available IP address for the VM instance from the available IP range to avoid IP conflicts.
Attach the GPU device of a host to the VM instance. Hence, the GPU device is used solely by the VM instance. However, you cannot perform migrations for the VM instance that attaches the GPU device.
Detach the GPU device from the VM instance.
Attach a USB device for the VM instance by enabling the USB passthrough feature. Once a USB device is attached to a VM instance, the USB device can be solely used by the VM instance. All USB devices attached by one VM instance can only run on the same host.
Detach the USB device from the VM instance.
Attach other peripheral devices to the VM instance by enabling the feature of other peripheral devices.
Detach other peripheral devices from the VM instance.
Create a scheduled job. Create a scheduled job based on a scheduler. Scheduled tasks such as stopping VM instances, starting VM instances, rebooting VM instances, and creating VM snapshots.
Create an alarm and add related alarm metrics. The system can automatically monitor multiple alarm metrics such as added CPU, disks, NICs, and memories of VM instances, and pushes alarm messages to you via email, DingTalk, HTTP application, and short message service.
Let you audit all operations of a VM instance to effectively safeguard the security of your core data on your cloud environment.
Reboot VM | Stop VM | Running VM |
---|---|---|
|
|
|
ps -ef|grep http
to check whether the host has contained the User Data.ip netns
to obtain namespace.ip netns exec namespace ip a
to check whether namespace has obtained the target IP address.# Obtain namespace: br_eth0_1101_f8e41fc3a3b9431d9ea5f2bf090e085e [root@localhost ~]# ip netns br_eth0_1101_f8e41fc3a3b9431d9ea5f2bf090e085e (id: 0) # Check whether namespace has obtained the target IP address:169.254.169.254 [root@localhost ~]# ip netns exec br_eth0_1101_f8e41fc3a3b9431d9ea5f2bf090e085e ip a 1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 10: inner0@if11: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 2e:6d:a4:6c:ab:79 brd ff:ff:ff:ff:ff:ff link-netnsid 0 inet 10.1.164.230/24 scope global inner0 valid_lft forever preferred_lft forever inet 169.254.169.254/32 scope global inner0 valid_lft forever preferred_lft forever inet6 fe80::2c6d:a4ff:fe6c:ab79/64 scope link valid_lft forever preferred_lft forever
/etc/rc.d/rc.local
, and executable permissions are provided. However, we recommend that you do not change the /etc/fstab
file of the VM instance. After you detach the volumes dynamically, if you reboot the VM instance, the VM instance may fail to be started in which the VM instance cannot find the volume information defined by /etc/fstab
./etc/rc.d/rc.local
, and run mount
to mount volumes to your VM instance as follows:# chmod +x /etc/rc.d/rc.local # mount -t Target mount path of the volume ID
Operating System | BIOS Mode | Supported Version |
---|---|---|
Windows | UEFI |
|
UEFI (compatibility module) |
| |
Linux | UEFI |
|
% echo online > /sys/devices/system/memory/auto_online_blocks % echo online > /sys/devices/system/memory/memoryXXX/state
For more information, see How to online memory.Data volumes are mainly involved in the volume management.
Enable the disabled volumes. Afterwards, you can attach the volumes to a VM instance. If you have already attached the volumes to the VM instance, disabling the volumes will not affect your business continuity. After you detach the volumes from the VM instance, you can no longer attach the volumes to the VM instance.
Disable the enabled volumes. Afterwards, the volumes cannot act as candidates that can be attached to other VM instances.
Attach volumes to a VM instance. You can attach the volumes to the VM instance that are in the running state or stopped state.
Detach volumes from a VM instance. After you detach the volumes from the VM instance, you can attach the volumes to other VM instances.
Migrate volumes. After you detach the volumes attached by a local storage, you can migrate the volumes to other hosts. After migration, you can attach the volumes to other VM instances that run on the target host.
Create a backup task for the current VM instances or volumes. The VM instances will be backed up as images, while the volumes will be backed up as volume backups.
Create volume images. Volumes can be encapsulated as images which can be used to create more volumes. Also, the volumes on a Ceph primary storage can be encapsulated to an ImageStore backup storage.
Let you resize volumes online. Resize data volumes as needed. After data volumes are resized, the capacities will take effect in real time. Data volumes can only be expanded at the minimum of 4 MB rather than be downsized.
When you use snapshots, you are not creating a copy of the virtual hard disk. But actually, you need to create a copy of the VM virtual disk. If the virtual disk is damaged, the snapshot will be invalid, which means that the snapshot cannot be used to recover the damaged disk. Notice that the snapshot cannot be used to solve disk failures. So, you will still encounter a single point of failure.
Using too many snapshots will influence the performance of a VM instance. For example, if the old snapshot runs on the VM instance with excessive overloads, this old snapshot will be increased in size, and then the performance of the VM instance will be definitely slowed down. Or, if you create a large number of snapshots, the performance of the VM instance will be also slowed down.
Reserving a snapshot of a VM instance for a long time is a common mistake. The snapshot will increase in size as the time goes by. Also. the snapshot files will also be changed, and are not stored on the source disk. Hence, restoring the snapshot will take a long time. Also, during restoring, the VM instance may be forced to stop.
Restore volumes to the current snapshot point. Before you restore snapshots, stop the VM instance that attaches the volumes or detach the volumes from the VM instance.
Change the owner of the volumes to other regular accounts.
Delete the attached, unattached, or uninstantiated volumes. If you delete the uninstantiated volumes, the volumes will be deleted immediately. After deletion, the system will no longer record these volumes.
Restore the deleted volumes to the running state.
Expunge the deleted volumes. The system will no longer record these volumes, and delete the actual data.
Create scheduled jobs based on schedulers. Currently, scheduled jobs of the volumes only support scheduled snapshot jobs of the data volumes, such as creating snapshots, enabling snapshots, disabling snapshots, and deleting snapshots.
# chmod +x /etc/rc.d/rc.local # mount -U UUID of the file system Target mount path
To add an image, add a URL or upload a local file.
Example: ftp://172.20.0.10/pub/zstack-image.qcow2
Example: ftp://zstack:password@172.20.0.10/pub/zstack-image.qcow2
Example: sftp://root:password@172.20.0.10/pub/zstack-image.qcow2
Example: sftp://root@172.20.0.10/pub/zstack-image.qcow2
Example: file:///opt/zstack-dvd/zstack-image-1.4.qcow2
When you add an image by uploading a local file, you use the local browser as a transit point. Therefore, do not refresh or close the current browser, and do not stop the management node service. Otherwise, the image might fail to be added.
Enable the disabled images. These images can act as candidates used to create VM instances.
Disable images. These images cannot act as candidates used to create VM instances.
Export ImageStore images. You can download the images directly. By default, the exported images are stored on the export subdirectory under the ImageStore directory. The details pages of the exported images can display MD5 values of the images. These values can be used to authenticate whether the downloaded images and the exported images are the same.
For SFTP backup storages, you can copy directly the path where the images are stored, and export the images.
For Ceph backup storages, you can export manually the images by running rbd export
via the Pool information where the images are stored.
Share images to all accounts. Hence, all regular accounts and project users can use these images.
Share images to one or more regular accounts or project users.
Recall images from all regular accounts and projects users. Recalling the images from all regular accounts and project users does not affect independent image sharing. You can specify some images. Hence, regular accounts and project users can still use these images.
Recall images from the specified regular accounts and project users.
Change the owners of the images to the regular accounts and project users.
Migrate the data of the images across network shared storages. Currently, migrations for the images can be performed across Ceph backup storages.
Migrate the images on a Ceph backup storage to other Ceph backup storages. After migration, the new Ceph backup storages can use these images, while the original Ceph backup storage will no longer reserve these original images. Before storage migrations are performed, make sure that the target Ceph backup storage has sufficient capacities.
Delete images. To expunge or restore the images, delete them first.
Restore the deleted images to the running state.
Expunge the deleted images. Then, the actual data on the backup storage will be deleted.
Download the exported images to the corresponding local disk via a browser.
Copy the URLs of the images, and add them to other clouds. Also, you can download these URLs by using wget directly.
Remove the exported images from a backup storage. These images will no longer occupy storage capacities.
Change the platform type for images. Afterwards, the new VM instances will determine which device drivers will be used according to the new type of platform. Platform options: Linux | Windows | WindowsVirtio | Other | Paravirtualization. Linux, WindowsVirtio, and Paravirtualization adopt Virtio drivers, while Windows and Other adopt QEMU emulation devices.
Enable the QGA option. Before you enable this option, make sure that you have preinstalled and run qemu-guest-agent
in the images. After you enable this option, the VM instances with these images let you change the VM passwords.
Refresh the actual capacities of the backup storage where the images reside.
Qemu guest agent
, verify that you have installed qemu-guest-agent
for the image. By default, the VM instances that you are creating let you change the VM passwords.du -sm
.Operating System | BIOS Mode | Supported Version |
---|---|---|
Windows | UEFI |
|
UEFI (compatibility module) |
| |
Linux | UEFI |
|
vim /boot/efi/startup.nsh
to create a script and save the following contents. For the later VM rebooting operation, the VM instance will skip the UEFI Shell and directly enter the operating system.FS0: CD EFI CD centos shimx64-centos.efi
Shell> fs0: FS0:\> cd EFI FS0:\EFI\> cd centos FS0:\EFI\centos\> shimx64-centos.efi
Shell> fs0: FS0:\> dir FS0:\> cd EFI FS0:\EFI\> cd BOOT FS0:\EFI\BOOT\> BOOTX64.EFI
After you perform the preceding operations, press any key to continue the VM operating system installation. Otherwise, the VM instance will enter the UEFI Shell again.Back to Top
Email Us
contact@zstack.ioEmail Us
contact@zstack.ioEmail Us
contact@zstack.ioThe download link is sent to your email address.
If you don't see it, check your spam folder, subscription folder, or AD folder. After receiving the email, click the URL to download the documentation.Thank you for using ZStack products and services.
Submit successfully.
We'll connect soon.Thank you for using ZStack products and services.