VM Instance

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.

Three Core Attributes

  1. Instance Offering:

    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.

  2. Image:

    Determine which image can be used to create a VM instance.

    When you select an image, note the following:
    • If a backup storage attached by the image is ImageStore, ZStack will automatically select a cluster that is attached by a type of primary storage such as LocalStorage, NFS, SharedMountPoint, Ceph, or SharedBlock to act as a candidate cluster.
    • If a backup storage attached by the image is SFTP (for Community version only), ZStack will automatically select a cluster that is attached by a type of primary storage such as LocalStorage, NFS, or SharedMountPoint to act as a candidate cluster.
    • If a backup storage attached by the image is Ceph, ZStack will automatically select the cluster attached by the Ceph primary storage that corresponds to the Ceph backup storage.
  3. Network:

    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.

Note:
  • After you complete configuring the preceding three attributes, various resources necessary to create the VM instance are all ready. In that case, available resources can be filtered in order of: the image attached to the backup storage->clusters available to the backup storage->associated networks available to the cluster.
  • If you select the network attached by multiple clusters that satisfy the preceding requirements, you can continue to filter the corresponding resources such as a cluster, primary storage, and host by expanding Advanced.
  • When you fail to select the L3 networks that you created, we recommend that you check whether:
    1. The L2 network attached by an L3 network attaches the corresponding cluster.
    2. The corresponding cluster has attached the corresponding primary storage.

Multi-Primary Storage Strategy

  • If a cluster has multiple LocalStorage primary storages attached:
    • You can specify any LocalStorage primary storage when you create a VM instance.
    • If you do not specify a primary storage, the system will automatically select the local primary storage that has the most available capacity.
  • If a cluster has multiple shared primary storages attached (currently, multiple NFS primary storages or Shared Block primary storages are supported):
    • You can specify any NFS or Shared Block primary storage when you create a VM instance.
    • If you do not specify a primary storage, the system will automatically allocate an NFS or a Shared Block primary storage that is available.
  • If a cluster has a combination of primary storages attached (currently, the supported combinations include: 1 LocalStorage + 1 NFS, 1 LocalStorage + 1 SMP, 1 LocalStorage + 1 Shared Block):
    • You can specify any primary storage when you create a VM instance.
    • When you create a VM instance, if you create a data volume and attach it to the VM instance at the same time, you need to specify a primary storage for the data volume.
    • If you do not specify a primary storage, the system will automatically use a local primary storage to create a VM instance.

VM Instance Operations

  • Start:

    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.

    When you start a VM instance, note the following:
    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.
    1. If the VM instance uses the root volume or data volume of a local storage, this VM instance can only be enabled on the last host where the VM instance resides.
    2. If this VM instance only uses a shared storage or shared storage with a data volume, this VM instance can be started on the available hosts attached by the primary storage.
    If you fail to start the VM instance, make sure that you check whether:
    • Hosts are connected to and enabled in the cluster where the VM instance resides. If no connected hosts are available, you will prompt for the information that you cannot find any available hosts.
    • Resources of the hosts running on the cluster, such as CPU and memory, are sufficient. Assume that all hosts running on the cluster have their own separate available CPUs and memories. If these CPUs and memories are insufficient to allocate to the VM instance, the Cloud will prompt you that you cannot find any available hosts.
    • The cluster where the VM instance resides attaches an L2 network. If the cluster has not attached any L2 network, the corresponding L3 network will not be assigned for this VM instance. Then, the Cloud will prompt you that this VM instance has no available networks and cannot be started.
    • The L2 network corresponded by the cluster where the VM instance resides is attached to an L3 network. If the L2 network attached by the cluster is not attached to any L3 network, this VM instance cannot attach any L3 network. Then, you will prompt for the information that this VM instance has no available networks and cannot be started.
    • The cluster where the VM instance resides is attached to a primary storage. If the cluster is not attached to any primary storage (generally, the case occurs after a primary storage is detached), you will prompt for the information that no root volumes of this VM instance are found. In that case, attach the original primary storage to the cluster before the VM instance can be normally started.
    • The primary storage where the cluster resides has availably sufficient capacities. This can be judged when you create the VM instance. If the primary storage cannot provide sufficiently required capacities for the VM instance, you will prompt for insufficient capacities of the primary storage.
  • Stop:

    Stop the VM instance that is in the running state. The VM instance will be stopped normally.

  • Reboot:

    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:

    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:

    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:

    Resume the VM instance that is in the paused state. Hence, the VM instance can continue to run normally.

  • Delete:

    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:

    Restore the VM instance that is in the deleted state to the stopped state.

  • Expunge:

    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.

  • Open console:
    Let you access the VM instance via the VNC mode. Ensure that your browser can reach the IP address of the console proxy. If you open the console of the VM instance successfully, but do not receive any content, verify that the IP address specified by the console proxy can be normally accessible to your guests (laptop). Change the IP address of the console proxy as required.
    Note: To change the IP address of a console proxy, choose Platform Management > Console Proxy.
  • Local storage migration:

    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.

  • Network shared storage migration:

    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.

  • Create image:
    Encapsulate the VM instance as an image which can be used to create more VM instances.
    • Create image online: When the VM instance is running, ImageStore and Ceph backup storages let you create an image online.
    • Create image offline: When the VM instance is stopped, various types of backup storages let you create an image.
  • Create VM snapshot:
    Before important operations are performed, ensure that the root volume or data volumes are temporarily reserved at a specific time, which can be used to quickly let you perform rollback after failures appear. If you need a long-term backup, use the related backup service. A VM snapshot includes the following types:
    • Single snapshot: Take only snapshots for the root volume of the VM instance.
    • Batch snapshot: Take batch snapshots for the root volume and all data volumes. While you create a VM snapshot, all data volumes attached by the VM instance will be taken snapshots as well. Batch snapshots can be recovered centrally as a unit.
    • You can create snapshots for running or stopped VM instances.
    • You cannot create batch snapshot for VM instances that have a shared volume attached.
    • In a production environment, we recommended that you limit the number of snapshots per disk within 5. Excessive snapshots might affect the I/O performance, data security, and primary storage capacity of the corresponding VM instances and volumes. For long-term backup, we recommend that you use disaster recovery related services.
    • To ensure data integrity in a production environment, we recommend that you do not take snapshots for VM instances with high I/O. When a high I/O operation is performed in a VM instance, some data in the VM memory might fail to be saved to the disk. In this case, these data will not be saved to the snapshot you created for the VM instance.
    • The snapshot of the VM instance on the Ceph primary storage does not occupy capacity. Therefore, the displayed snapshot capacity is the actual capacity of the VM root volume when the snapshot was created.
    • For Ceph primary storages, the VM snapshot capacity might fail to be obtained. Here are some statements:
      • Open source Ceph (version H) and enterprise-level Ceph (earlier than 3.2.0) cannot obtain VM snapshot capacity.
      • Due to the RBD format, enterprise-level Ceph (3.2.0 and later versions) may fail to obtain VM snapshot capacity.
    Note:
    • Snapshots, a short-term solution, mainly can be used in test and development environments. Specifically, these snapshots can quickly be used for packing, upgrading, or testing your Cloud. When normal failures appear, rollbacks can be performed. We recommend that you do not use snapshots in your production environment. However, under some circumstances, snapshots can still be applied to your production environment. For example, if you perform dangerous operations, the probable damage to the operating system may occur due to upgrading or configuration modifications. Then, snapshots are a preferred solution.
    • We recommend that you do not use snapshots in your production environment. The following are the two probable considerations:
      • Data integrity

        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.

      • VM performance

        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 snapshot:

    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.

    Note:
    • For a single snapshot, you can only restore the VM root volume to the time of point when the snapshot was taken.
    • For a batch snapshot, you can restore both the root volume and data volume to the time of point when the snapshot was taken.
    • You can restore snapshots only for VM instances that are stopped. Before you restore a snapshot, stop the corresponding VM instance.
    • You can choose whether to automatically start the corresponding VM instance after restoring from a snapshot.
    • If a VM batch snapshot is displayed as not restorable, the possible reasons are as follows:
      • At least one data volume snapshot in the batch snapshot was deleted. In this case, you can only restore single snapshots.
      • At least one data volume attached by the VM instance was deleted. In this case, you can only restore single snapshots.
      • At least one data volume attached by the VM instance was detached. In this case, you can only restore single snapshots. To restore the batch snapshot, attach the detached data volumes to the VM instance again.
      • The VM instance has a new data volume attached. In this case, you can only restore single snapshots. To restore the batch snapshot, detach the new data volume from the VM instance.
  • Delete snapshot:
    Delete the unnecessary snapshots. Snapshots can be deleted in bulk.
    Note:
    • Snapshots created on local storage, NFS, SMP, and Shared Block storages have a tree structure. Deleting the root snapshot will also delete snapshots on the branches and detach the batch snapshots on the branches. Please exercise caution.
    • Snapshots created on the Ceph shared storage are independent and do not have a tree structure. Deleting a snapshot will not affect other snapshots.
    • When you delete snapshots in a tree structure in bulk, the cloud automatically calculates and deletes the candidate snapshots and cascades the delete operation to the associated snapshots.
    • If the snapshots to be deleted contain batch snapshots, note that:
      • Deleting a batch snapshot will also delete the data volume snapshots in the batch snapshot and the snapshots on the branches. Please exercise caution.
      • Deleting single snapshots and batch snapshots in bulk will also delete the single snapshots on the branches and detach the batch snapshots on the branches.
  • Detach batch snapshot:

    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.

  • Clone:

    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.

    • Cloning VM instances online only applies to the disk data that have been written when a cloning job begins, excluding the real-time cache data. To ensure data integrity, high I/O VM instances are recommended to enter paused or stopped state before a cloning job is performed.
    • Configurations, installation programs, and passwords of a VM instance will be copied to the newly cloned VM instance. However, copies of other configurations are not included, such as tags and scheduled jobs.
    • Assume that the cloned VM instance is in the running state. After the VM instance is rebooted, the VM console password will take effect.
    • When a VM instance is cloned, if you use a SharedBlock primary storage, select a provision mode for the VM instance, including thick provision and thin provision.
      • Thick provision: Preallocate the required storage space, and provide sufficient storage capacities for the VM instance to ensure the storage performance.
      • Thin provision: Allocate the storage space to the VM instance as needed to achieve higher storage utilizations.
    • When a VM instance is cloned, if you use a Ceph primary storage, you can specify a storage pool.
      • When a VM instance is cloned without volumes, a Ceph storage pool (root volume pool) can be specified.
      • When you use an ImageStore backup storage to clone a VM instance with volumes, you can specify a data volume pool and a root volume pool.
    • When you clone a VM instance, ensure that you do not set a static IP address for the source VM instance. Otherwise, the IP address will be duplicated in multiple VM instances, which will lead to login errors.
  • Create backup data: Backs up the VM instance on the Cloud to an off-site server or to Public Cloud remote disaster recovery server.
  • Create volume:

    Create data volumes from the primary storage attached by a cluster where the VM instance resides.

    If you have multiple types of primary storages, you can specify a type of primary storage to create volumes.
    • For multiple LocalStorage primary storages, an availably large capacity of storage will be selected to create volumes for the VM instance by default.
    • For multiple NFS primary storages or multiple SharedBlock primary storages, a type of primary storage will be randomly selected to create volumes for the VM instance by default.
    • For LocalStorage +NFS/Shared Mount Point/Shared Block, a type of primary storage where the root volume of the VM instance currently does not reside will be selected.

    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.

  • Attach or detach volume:
    • Attach volume: Create volumes for the VM instance on the primary storage attached by a cluster where the VM instance resides.
    • Detach volume: Detach volumes from the VM instance. To perform cold migrations and storage migrations for local storages, detach related data volumes.
  • Resize volume:

    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.

  • Create VM image:

    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.

  • Attach or detach ISO:
    • Attach or detach an ISO image. Make sure that you add an ISO image in advance. After the image is added successfully, the VM instance can detect and attach this image.
    • If you plan to repair the operating system or reinstall the operating system, you can attach an ISO image, adjust the boot order by prioritizing the ISO image, and reboot the VM instance with the ISO wizard.
    • Let you attach multiple ISO images. You can attach 3 ISO images to the VM instance at most. Also, you cannot attach ISO images in bulk.
  • Create or delete vDrive:
    • Make sure that you stop the VM instance in advance. Then, you can create or delete the vDrive.
    • To set the maximum number of virtual drives for a VM instance as needed,

      Choose Settings > Global Settings > Advanced, and set maximumCdRomNum. Default value: 3. Options: 1 | 2 | 3.

    • Deleting CDROMs and modifying default devices will affect the device names and ISO mappings. Specifically, the influence is as follows:
      • Deleting CDROMs will change the order for the rest of CDROMs successively. For example, assume that you have three CDROMs: CDROM-1, CDROM-2, and CDROM-3. If you delete CDROM-2, all ISO images attached to the CDROM-3 will be changed to CDROM-2.
      • Modifying default CDROMs will change the device serial numbers of the CDROMs. For example, assume that you have three CDROMs: CDROM-1, CDROM-2, and CDROM-3. If CDROM-2 is set as default, CDROM-2 with all its ISO images will be changed to CDROM-1, and the original CDROM-1 will become CDROM-2.
  • SSH Login Method: Allow you to use the SSH key or password if you have image files preconfigured with Cloud-init.
    • If you use an SSH key, set the following parameter:
      • SSH Key: After an SSH key is injected to a VM instance, you can SSH in to the VM instance without entering a password when the VM instance is running.
    • If you use a password, set the following parameters:
      • User Name: By default, the user name is root.
      • Password: After a root password is injected to a VM instance, you can SSH in to the VM instance by entering a password when the VM instance is running.
      Note:
      • The root password setting method only applies to Linux VM instances. For Windows VM instances, you can set passwords by using User Data.
      • Before you set the password, make sure that the VM image has the Cloud-init installed. Recommended versions for Cloud-init: 0.7.9, 17.1, 19.4, and the later versions.
      • After you set a password, do not set the password again in User Data to avoid conflicts.
      • After you set a root password, a clear text password will be displayed in the User Data on the details page of the created VM instance. Keep your password confidential.
    Note: Different types of images support different SSH login methods.
    • Images of different operating systems:
      • Linux image: Fixed user name: root. Supported SSH login methods: SSH key | password.
      • Windows image: Fixed user name: administrator. Supported SSH login method: setting password by using User Data.
    • Images of different formats:
      • Image of the ISO type: Supported SSH login method: SSH key.
      • Image of the Image type: Supported SSH login methods: SSH key | password.
  • Set host name:
    • The rules for setting Linux hostname and Windows hostname are different.
      • Linux hostname: The hostname must be 2 to 60 characters long, and can be uppercase, lowercase, numbers, and hyphens (-). Note that a hostname cannot contain consecutive hyphens (-) and cannot start or end with hyphens (-).
      • Windows hostname: The hostname must be 2 to 15 characters long, and can be uppercase, lowercase, numbers, and hyphens (-). Note that a hostname cannot contain consecutive hyphens (-), cannot start or end with hyphens (-), and cannot contain only numbers.
    • Before you set a hostname, make sure that the DHCP service of the L3 network corresponding to the VM instance is enabled.
    • For Linux images, the hostname must be set to localhost.localdomain.
    • After you set a hostname, do not set it again in User Data to avoid conflicts.
  • SSH key management:

    After 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.

    For your reference, to inject an SSH key into a VM instance:
    1. Install Cloud-init.
      Currently, you can inject an SSH Key into a VM instance by using Cloud-init. To inject the SSH Key into the VM instance, install Cloud-init in advance.
      1. Install Cloud-init by yourself. Recommended versions: 0.7.9, 17.1, 19.4, and their later versions.
      2. After you complete installing Cloud-init, the SSH password authentication defaults to be disabled. To enable the SSH password authentication, set the ssh_pwauth option under /etc/cloud/cloud.cfg to 1.
    2. Generate an SSH Key.
      1. The SSH Key is generated by the ssh-keygen command. By default, the SSH Key is stored in /root/.ssh/id_rsa.pub.
      2. Paste the file content into the SSH Key input box.
    3. Inject the SSH Key into the VM instance.
      You can inject the SSH Key into the VM instance by the following two methods:
      • Method 1: When you create a VM instance, enter an SSH Key under the Advanced option.
      • Method 2: If you have created a VM instance, enter an SSH Key by selecting Add SSH KEY under the Actions of the VM instance.
      After you inject the SSH Key, you can check the basic information of the corresponding SSH Key at the VM instance details page, such as user name and host information of the corresponding key.
    Note:
    • When you create a VM instance, injecting an SSH Key into the VM instance will take effect immediately.
    • When you inject an SSH Key into the VM instance that is in the start state or running state, clean up the previous configurations by running rm -rf /var/lib/cloud/instances, and then reboot the VM instance. Finally, the SSH Key will take effect.
    • On the VM actions page, click Delete SSH KEY. Only the SSH Key information recorded in the system is deleted, while the related information of the injected SSH Key is not deleted or removed.
    • If you need to delete the SSH Key that has been taken effect, clean up manually the SSH Key under /root/.ssh/authorized_keys in the VM instance.
  • Set high availability:

    If resources on hosts are sufficient, the VM instance configured with NeverStop will never be stopped.

    • Assume that the volumes of the VM instance are attached to a local storage. After the host where the VM instance resides is abnormally stopped, this VM instance will not be started again until the host recovers to the availably connected status.
    • Assume that the volumes of the VM instance are attached to a shared storage. When resources on hosts are sufficient, the VM instance will keep running normally. Even if the VM instance stops, it will be rebooted. If the host where the VM instance resides is abnormally powered off and stopped, this VM instance will be rebooted on other available hosts.
    • You can set the NeverStop VM instance to not be automatically rebooted.
    • The rebooting progress of the NeverStop VM instance can be displayed on the web UI.
  • Change instance offering or change CPU and memory:
    Changes the CPU, memory, disk QoS, and network QoS.
    • Change online: Let you change the CPU, memory, disk QoS, and network QoS of the VM instance by enabling NUMA globally. These settings will take effect after the VM instance is rebooted or the new VM instance is created. We recommend that you do not change the CPU and memory for the Windows VM instance in your production environment. On the contrary, we recommend that you change online the configurations of the Windows VM instance after the VM instance is stopped. If you change an instance offering online, you can only increase the CPU and memory rather than decrease them.
    • Change offline: Change the configurations of the VM instance after the VM instance is stopped.
  • Set boot order:

    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.

  • Enable (Specify hosts):

    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.

  • Set or cancel console password:
    Set or cancel the console password. After you set the console password, you can access the VNC console by entering the correct console password. On the contrary, after you cancel the console password, you can access the console of the VM instance without passwords.
    Note: When you set and cancel the console password, if you do not select Reboot, you need to manually reboot the VM instance on the web UI before all settings take effect.
  • Reimage 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 owner:

    Change the owner of the VM instance to another regular account.

  • Set RDP mode:

    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.

  • USB redirection:

    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.

  • QGA option:

    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.

  • Change 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.

  • Resize root volume:
    Expand the root volume for the VM instance.
    • If you use a Linux VM instance partitioned by Logical Volume Manager (LVM), you can expand directly the operating system partitions by running lvextend.
    • A Windows VM instance can also let you right-click Disk Management to expand the root volume.
  • Switch console mode:

    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.

  • Migrate storage: Perform cold migrations for the VM instance across same types of primary storages, and perform hot migrations for the VM instance across different types of primary storages.
    • Perform cold migrations across the same types of primary storage: Let you perform cold migrations for a VM instance across the same types of primary storage, including Ceph-Ceph, NFS-NFS, and SharedBlock-SharedBlock.
      Note:
      • Storage migrations across Ceph primary storages:
        • Before you perform migrations, you must stop the VM instance and then detach all its data disks.
        • MON nodes between two Ceph primary storages must be interconnected.
      • Storage migrations across NFS primary storages:
        • Before you perform migrations, you must stop the VM instance and then detach all its data disks.
        • The target NFS primary storage can be attached to the cluster where the VM instance to be migrated resides.
      • Storage migrations across SharedBlock primary storages:
        • Before you perform migrations, you must stop the VM instance. You can perform migrations for the VM instance with volumes.
        • If the VM instance attaches shared volumes, the shared volumes cannot be migrated with the VM instance simultaneously.
        • The target SharedBlock primary storage can be attached to the cluster where the VM instance to be migrated resides.
      • The cluster attached by the target primary storage can meet the network needs of the VM instance.
    • Hot migrations across different types of primary storage: Let you perform hot migrations for the VM instance across different types of primary storages, including Ceph-SharedBlock, LocalStorage-SharedBlock, and LocalStorage-Ceph.
      Note:
      • Before you perform migrations, do not stop the VM instance.
      • You can only perform migrations for the VM instance with the regular volumes. If the VM instance attaches shared volumes, the shared volumes cannot be migrated with the VM instance simultaneously.
      • After you perform storage migrations for the running VM instance, snapshots for the VM instance will not be reserved.
      • The cluster attached by the target primary storage can meet the network needs of the VM instance.
  • Bind or unbind affinity group: Bind/unbind the VM instance to/from an affinity group.
    Currently, ZStack provides two affinity group policies to better manage VM instances and hosts: anti-affinity group (soft) and anti-affinity group (hard).
    • Anti-affinity group (soft):

      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.

    • Anti-affinity group (hard):

      Strictly allocate VM instances in the affinity group to different hosts. If no more hosts are available, the allocation fails.

  • Change operating system:
    After the VM instance is stopped, you can change the operating system by specifying the target image. Notice that the target image must be the Image type: qcow2 and raw. After you change the operating system, the VM instance stays in the stopped state.
    • Changing the operating system for the VM instance will expunge all its original operating system disks and snapshots. Make sure that the related backups are performed before you confirm the change of the operating system to avoid data loss.
    • If a scheduled job to create snapshots for the VM instance is failed, ensure that you make configurations for the scheduled job again.
    • When the VM instance attaches data volumes, you can switch different types of the operating system, such as switching Linux to Windows.
    • When you switch across different types of the operating system, the partition format of data volumes will probably fail to be detected and identified.
  • Set QoS:

    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.

  • Inject User Data:
    • Before you import User Data, make sure that both the User Data network service and DHCP network service are available.
    • By default, the User Data network service and DHCP network service in the three network environments of flat network, vRouter network, and VPC network are enabled.
    • If you set a hostname and password by using the User Data, do not set them again in SSH Login Method to avoid conflicts.
    • After you set a root password by using the User Data, a clear text password will be displayed in the User Data field on the details page of the created VM instance. Very that you keep your password confidential.
    • When you import the User Data to a Linux VM instance, note the following:
      • Cloud-init must be installed for the VM image. Recommended versions: 0.7.9, 17.1, 19.4, and the later versions.
      • If you create a Linux VM instance by using a VM image that has Cloud-init installed, you must import the User Data. Otherwise, the Cloud-init task will wait until the task times out.
      • The following is an example of importing the User Data to a Linux 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
        The preceding script can be realized by following the steps below:
        1. Create a user named test and use ssh-key when a VM instance is created.
        2. Write the /etc/hosts file when the VM instance is started, create a directory named /tmp/temp, create a file, and write content to the file.
        3. Set the hostname, enable the root user, allow the SSH login with passwords, and change the root password.
        4. Run the echo ls -l / command.
    • When you import the User Data to a Windows VM instance, note the following:
      • Cloudbase-Init must be installed for the VM image. The version of the Cloudbase-Init is not enforced. For information about how to install Cloudbase-Init, see Cloudbase Documentation.
      • If you create a Windows VM instance by using a VM image that has Cloudbase-Init installed, you must import the User Data. Otherwise, the Cloudbase-Init task will wait until the task times out.
      • The following is an example of importing User Data to a Windows VM instance:
        #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.

      Note: When the User Data is used, one L2 network can only let you configure one L3 network.
    Note: When you use the User Data, notice that you can configure only one L3 network for an L2 network.
  • Change platform:

    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.

  • Change session count:

    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.

  • Attach NIC:

    Select available networks to attach to the VM instance from the available L3 network list.

  • Detach NIC:

    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.

  • Change default network:

    Let you change the default network for the VM instance. Ensure that you restart the network service before all settings take effect.

  • Set MAC:

    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 specified IP:

    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 GPU device:

    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 GPU device:

    Detach the GPU device from the VM instance.

  • Attach USB device:

    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 USB device:

    Detach the USB device from the VM instance.

  • Attach GPU specification:
    Attach GPU specifications for one or more VM instance.
    Note: If the VM instance has already attached a GPU specification, GPU device, or if the VM instance is in the running state, this VM instance cannot attach another GPU specification.
  • Change GPU specification:
    Change a GPU specification for one or more VM instances.
    Note:
    • If the VM instance has not attached any GPU specification, or if the VM instance is in the running state, you cannot change the GPU specification for the VM instance.
    • After you change the GPU specification, you can attach a GPU device by using the latest GPU specification to the VM instance when the VM instance is started next time. Also, you can detach the GPU device associated to the original GPU specification from the VM instance.
  • Cancel GPU specification:
    Cancel the GPU specification of one or more VM instances.
    Note: If the VM instance has not attached any GPU specification, or if the VM instance is in the running state, you cannot cancel the GPU specification.
  • Attach other peripheral devices:

    Attach other peripheral devices to the VM instance by enabling the feature of other peripheral devices.

  • Detach other peripheral devices:

    Detach other peripheral devices from the VM instance.

  • Scheduled job:

    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.

  • Alarm:

    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.

    If you want to use some specific alarm metrics, install agents for your VM instances in advance. For more information about how to install an agent, see Internal Monitoring.
    Note: Compared to the external monitoring, the internal monitoring is more accurate. We recommend that if you want to monitor the internal data, use the internal monitoring.
  • Audit:

    Let you audit all operations of a VM instance to effectively safeguard the security of your core data on your cloud environment.

A VM instance lets you perform multiple operations. All settings take effect after different constrains are followed, such rebooting the VM instance, stopping the VM instance, or keeping the VM instance running. Different operations can be performed according to different constrains as follows:
Reboot VM Stop VM Running VM
  • Set the NUMA architecture
  • Change the graphics card type
  • Change the CPU mode of the VM instance
  • Change the cache mode of the VM instance
  • Change the console mode of the VM instance
  • Set or cancel the console password of the VM instance
  • Set the USB redirection
  • Set the platform type
  • Set the boot order
  • Start the VM instance
  • Migrate storages
  • Change the operating system
  • Restore snapshots
  • Enable the specified host
  • Set the MAC address
  • Reimage the VM instance
  • Set or cancel the specified IP address
  • Clone the VM instance
  • Network Anti-Spoofing
  • Bind or unbind affinity groups
  • Create or delete snapshots
  • Create, delete, attach, or detach volumes
  • Create volume images
  • Create VM images
  • Create backup tasks (Both the enterprise version and the hybrid version are supported)
  • Create or delete scheduled jobs
  • Change the owner
  • Change the password online
  • Attach or detach NICs
  • Attach or detach GPU devices
  • Attach or detach ISO images
  • Attach or detach USB devices
  • Set or cancel NIC QoS
  • Set or cancel volume QoS
  • Set QGA
  • Set the RDP mode
  • Set the maximum login sessions for VDI devices
  • Set high availability
  • Resize volumes
  • Set VM high availability in the Settings
  • Migrate the VM instance online (shared storages)
  • Set over-provisioning ration of primary storages in the Settings
  • Set the usage threshold for primary storages in the Settings
  • Change memories online
  • Change the expunge period
  • Change the instance offering
  • Resize the root volume
  • Attach or detach the tag
  • Create the backup
  • Add or delete the SSH Key
  • Set the resource priority
  • Set the cross-cluster high availability policy

Notice

When you use a VM instance, note the following:
  • If the snapshot chain of the VM instance is long, the I/O performance of the VM instance may be getting poor.
  • After you set a name for the host, make sure that you do not set the host name again with User Data to avoid conflicts.
  • When you inject the User Data into the VM instance, note the following:
    • Before you inject the User Data, make sure that User Data network services and DHCP network services work normally. By default, User Data network services and DHCP network services are enabled in the scenarios of flat networks, vRouter networks, or VPC networks.
    • Install Cloud-init for the images of Linux VM instances in advance. Also, install Cloudbase-Init for the images of Windows VM instances in advance.
    • To check whether the User Data is injected into a Linux VM instance, go to /var/lib/cloud/instance/user-data.txt. If this file path does not contain the User Data, log in to the host where the VM instance resides, and run the following commands:
      • Run ps -ef|grep http to check whether the host has contained the User Data.
      • Run ip netns to obtain namespace.
      • Run ip netns exec namespace ip a to check whether namespace has obtained the target IP address.
        For example,
        # 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
  • By default, data volumes adopt Virtio devices. To detect and identify the Virtio devices, install the corresponding drivers. All Linux distributions have defaulted to integrate Virtio drivers. However, you need to install manually the Virtio drivers in your Windows.
  • For shared volumes, you must use the Virtio SCSI volumes. VM instances that attach the Virtio SCSI volumes can read and write the volumes. Ceph primary storages support shared volumes.
  • If you want to use the GPU passthrough feature, enable the IOMMU or VT-d options on BIOS of the host in advance.
  • When a VM instance has multiple NICs, if you change the default NIC, restart the network services within the VM instances before all settings take effect.
  • We recommend that Linux volumes that are automatically attached to your VM instance after the VM instance starts are written on /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.
    • We recommend that you perform the following operations:
      Go to /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
      Note: We recommend that you attach volumes by using their file system UUIDto VM instances rather than using drive letters similar to /dev/vdb.
  • The VM instance will inherit its BIOS mode, including Legacy and UEFI.
    Note:
    • You need to get the corresponding image ready, and select a proper BIOS mode. For more information, see Add Image.
    • You can change the BIOS mode on the VM details page. Exercise caution when you make any changes. The VM instance may fail to work properly if the BIOS mode does not match the VM instance. After you change the BIOS mode, restart the VM instance for the changes to take effect.
    • For ZStack 3.3.0 and later versions:
      • For beginners who install the Cloud for the first time, if your VM instances are booted from the UEFI mode, the motherboard type defaults to Q35. If your VM instances are booted from the Legacy mode, the motherboard type defaults to i440FX.
      • For users who want to upgrade the Cloud, upgrade the Cloud from the historical versions to 3.3.0 or later versions. Assume that your VM instances are booted from the UEFI mode. If the previous motherboard type is i440FX, the motherboard type will change to Q35 by default after the Cloud is upgraded.
      • The Legacy mode is recommended when you create a VM instance. If you want to use the UEFI mode, we recommend that you select the corresponding image from the following list of operating system versions.
        Operating System BIOS Mode Supported Version
        Windows UEFI
        • Windows 8 or later versions
        UEFI (compatibility module)
        • Windows 7
        • Windows Server 2008 R2
        Linux UEFI
        • CentOS 7.2
        • CentOS 7.3
        • CentOS 7.4 or later versions
  • In the Global Settings, after you enable the NUMA option, you can change the CPU and memories for your VM instances online, and ensure that you note the following:
    • We recommend that you do not change the CPU and memories for Windows VM instances online in production environments.
    • You can only expand the CPU and memories for the running VM instances. If you need to downsize the CPU and memory for the running VM instances, stop the VM instances.
    • If you want to expand the memories for the running VM instances, but VM instances cannot automatically activate the new memories, run the following two commands:
      % 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.
  • If an IPv6 network is used by VM instances, note the following:
    • If you want to create VM instances by using a network with the IPv6 type or IPv4+IPv6 type, run the dhclient -6 NIC_NAME command to manually obtain an IP address.
    • We recommend that you use only one IPv6 IP address for a VM instance to avoid potential risks.
    • If the IP address type of the L3 network (including public network, flat network, and VPC network) is changed, restart the VM instances that use this network for the configurations to take effect.

Volume

A volume provides storages for VM instances. A volume can either be a root volume or a data volume.
  • Root volume: A system disk where the VM instance operating system is installed.
  • Data volume: A data disk that provides additional storages for a VM instance.

Data volumes are mainly involved in the volume management.

Volume Operations

  • Enable:

    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:

    Disable the enabled volumes. Afterwards, the volumes cannot act as candidates that can be attached to other VM instances.

  • Attach:

    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:

    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:

    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 backup task:

    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 image:

    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.

  • Resize volume:

    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.

  • Create snapshot:
    Create volume snapshots. Before you perform any important operations, reserve the temporary state of the root volumes or data volumes at a specific time point. Hence, you can quickly perform rollbacks for the root volumes or data volumes when failures occur. If you need long-term backups, select related features of backup services.
    • In a production environment, we recommended that you limit the number of snapshots per disk within 5. Excessive snapshots might affect the I/O performance, data security, and primary storage capacity of the corresponding VM instances and volumes. For long-term backups, we recommend that you use disaster recovery related services.
    • Currently, you cannot create snapshots for shared volumes.
    • The snapshot of the volume on the Ceph primary storage does not occupy capacity. Therefore, the displayed snapshot capacity is the real capacity of the volume when the snapshot was created.
    • For Ceph primary storages, the volume snapshot capacity might fail to be obtained. Here are some statements:
      • Open source Ceph (version H) and enterprise-level Ceph (earlier than 3.2.0) cannot obtain volume snapshot capacity.
      • Due to the RBD format, enterprise-level Ceph (3.2.0 and later versions) may fail to obtain VM snapshot capacity.
    Similar to creating snapshots for root volumes of a VM instance, after you detach the volumes from the running VM instance, you can also create snapshots.
    Note:
    • Snapshots, a short-term solution, mainly can be used in test and development environments. Specifically, these snapshots can quickly be used for packing, upgrading, or testing your Cloud. When normal failures appear, rollbacks can be performed. We recommend that you do not use snapshots in your production environment. However, under some circumstances, snapshots can still be applied to your production environment. For example, if you perform dangerous operations, the probable damage to the operating system may occur due to upgrading or configuration modifications. Then, snapshots are a preferred solution.
    • We recommend that you do not use snapshots in your production environment. The following are the two probable considerations:
      • Data integrity

        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.

      • VM performance

        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 snapshot:

    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.

  • Delete snapshot:
    Delete the unnecessary the volume snapshots.
    Note:
    • Snapshots created on local storage, NFS, SMP, and Shared Block storages have a tree structure. Deleting the root snapshot will also delete snapshots on the branches and detach the batch snapshots on the branches. Please exercise caution.
    • Snapshots created on the Ceph shared storage are independent and do not have a tree structure. Deleting a snapshot will not affect other snapshots.
    • When you delete snapshots in a tree structure in bulk, the cloud automatically calculates and deletes the candidate snapshots and cascades the delete operation to the associated snapshots.
    • If the snapshots to be deleted contain batch snapshots, note that:
      • Deleting a batch snapshot will also delete the data volume snapshots in the batch snapshot and the snapshots on the branches. Please exercise caution.
      • Deleting single snapshots and batch snapshots in bulk will also delete the single snapshots on the branches and detach the batch snapshots on the branches.
  • Change owner:

    Change the owner of the volumes to other regular accounts.

  • Migrate storage:
    Volumes support migrations across network shared storages. Currently, Ceph and NFS storage migrations are supported.
    • Migration across Ceph primary storages:
      • Volumes to be migrated across Ceph primary storages cannot be attached to any VM instance.
      • Shared volumes that are not attached to VM instances can be migrated across Ceph primary storages. However, shared volumes that have been attached to VM instances cannot be migrated across Ceph primary storages.
      • To migrate between two Ceph primary storages, make sure that the Ceph MON nodes between these two Ceph primary storages are interconnected.
    • Migration across NFS primary storages:
      • Volumes that are migrated across NFS primary storages cannot be attached to any VM instance.
      • To migrate volumes between two NFS primary storages, make sure that the destination NFS primary storage can be attached to the cluster of the volumes to be migrated.
    • Migration across SharedBlock primary storages:
      • Volumes on SharedBlock primary storages can be attached to VM instances that are in the stopped state and migrated across SharedBlock primary storages.
      • Shared volumes that are not attached to VM instances can be migrated across SharedBlock primary storages. However, shared volumes that are attached to the VM instances cannot be migrated across SharedBlock primary storages.
      • To migrate volumes between two SharedBlock primary storages, make sure that the destination SharedBlock primary storage can be attached to the cluster of the volumes to be migrated.
  • Delete:

    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:

    Restore the deleted volumes to the running state.

  • Expunge:

    Expunge the deleted volumes. The system will no longer record these volumes, and delete the actual data.

  • Scheduled job:

    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.

Notice

When you use volumes, note the following:
  • Volumes are hypervisor specific. That is, a volume that has been attached to a VM instance of one hypervisor type cannot be attached to a VM instance of another hypervisor type. For example, a volume of KVM VM instances cannot be attached to VMware VM instances.
  • A volume can have two sizes: real size and virtual size. The real size is the size that a volume actually occupies in the storage system, while the virtual size is the size that a volume claims for. The virtual size is usually greater than or equal to the real size. As the number of written files increases, the real size will gradually increase.
  • A volume (excluding shared volumes) can only be attached to one VM instance at any given time. Ceph and Shared Block primary storages support shared volumes. A shared volume can be identified and accessed by multiple VM instances at the same time.
  • A root volume is always attached to its owner VM instance and cannot be detached.
  • A data volume can be attached to or detached from different VM instances of the same hypervisor type.
  • In the environment where multiple primary storages are available, you can specify a primary storage to create a volume. If no primary storage is specified, the default creation method is as follows:
    • For local primary storages, volumes are created from the primary storage with large capacity.
    • For NFS primary storages, volumes are created from a random primary storage.
    • For mixed primary storages (local + NFS/Shared Mount Point), volumes are created from the primary storage where the root volume of the volume does not locate.
  • You can set QoS for data volumes to limit the disk bandwidth. Note that excessive low QoS might cause low I/O performance.
  • When volumes are stored on a primary storage, verify that the primary storage is available and is in the connected status before the volumes can work normally.
  • When you create volumes, specify disk offerings.
  • When you create volumes, if you do not specify a primary storage, the created volumes are uninstantiated.
  • Uninstantiated volumes do no occupy any storage space. Only if the volumes are attached to VM instances, the volumes will be instantiated and occupy actual storage spaces.
  • After you specify a primary storage, if the specified disk offering exceed the availably virtual capacities of the current primary storage, you will prompt for insufficient capacities of the primary storage.
  • If the specified primary storage is LocalStorage, select available hosts attached by the cluster in the primary storage.
  • VirtioSCSI volumes adopt the VirtioSCSI bus. Volumes fall into the SCSI category, provides the I/O multi-queue support, and can be identified by WWN (World Wide Name).
  • A Ceph primary storage supports shared volumes which can be identified and accessed simultaneously by multiple VM instances.
  • After you detach the volumes in a local storage from a VM instance, these volumes can be migrated to other hosts. After migration, you can attach these volumes to the VM instances on a new host.
  • You can create snapshots for volumes, indicating that you can back up data of the volumes at a specific time point. When the data are lost, you can effectively restore the data by using rollbacks. Notice that snapshots created on a LocalStorage primary storage, NFS primary storage, and Shared Mount Point primary storage are tree mode. Deleting the tree root snapshot (root snapshot in the tree) will delete the tree leaf snapshots (snapshots in the branch of the tree) as well. Snapshots created on a Ceph storage are independent. Deleting a snapshot will not affect other snapshots.
  • Volume snapshots are all incremental. Exercise caution. After restoration, the data of the snapshot point will be recovered, and all data in the volumes will be overwritten.
  • Volume strategy with multiple primary storages:
    • When you have multiple primary storages, you can specify a primary storage to create volumes.
    • Assume that a primary storage is not specified, note the following:
      • If you have multiple LocalStorage primary storages, a primary storage with availably large capacities will be prioritized to create a volume for a VM instance when you create the VM instance.
      • If you have multiple NFS primary storages or SharedBlock primary storages, a type of primary storage will be randomly selected to create a volume for a VM instance when you create the VM instance.
      • If you have LocalStorage+NFS/Shared Mount Point/Shared Block primary storages, a type of primary storage different from the same primary storage where the current root volume resides will be selected by default to create a volume for a VM instance.
  • You can set QoS to limit the disk bandwidth for volumes. Notice that QoS must not be underused. The underused QoS will lead to poor I/O performance.
  • Attaching or detaching volumes are dynamical, while /etc/fstab of a VM instance is a static configuration file. Assume that you change the fstab file of a VM instance after you attach a volume to the VM instance, and then detach the volume from the VM instance. Once the VM instance is rebooted, the VM instance will fail to be started. The VM instance is hung or suspended so that it cannot be started, because the fstab file does not contain any corresponding information.
    We recommend that you perform the following operations:
    • Go to /etc/rc.d/rc.local, and run the mount command to mount volumes to your VM instance as follows:
      # chmod +x /etc/rc.d/rc.local # mount -U UUID of the file system Target mount path
      Note: We recommend that you attach a volume to VM instances rather by using the file system UUID of the volume than using drive letters similar to /dev/vdb.

Image

An image is an image template used by a VM instance or volume.
  • Image templates include root volume images and data volume images.
  • Root volume images can be in the format of ISO or Image, while data volume images can be in the format of Image.
  • The Image format can either be raw or qcow2.
  • Images are stored on backup storage. If you are creating VM instances or volumes for the first time, the images will be downloaded to primary storage and stored as image caches.
When you create a VM instance, the type of the image platform decides whether to use a KVM Virtio driver (including disk driver and NIC driver). The supported image platforms are as follows:
  • Linux: Uses a Virtio driver.
  • Windows: Not to use a Virtio driver. Instead, QEMU is used. The image operating system is a Windows OS without a Virtio driver installed.
  • WindowsVirtio: Uses a Virtio driver. The image operating system is a Windows OS with a Virtio driver (including disk driver and NIC driver) installed.
  • Other: Not to use a Virtio driver. Instead, QEMU is used. The image operating system can be of any types.
  • Paravirtualization: Uses a Virtio driver. The image operating system can be any operating system with a Virtio driver installed.

To add an image, add a URL or upload a local file.

  1. URL: Adds an image through the specified URL.
    • HTTP/HTTPS:
      • Format: http://path/file or https://path/file
      • Example: http://cdn.zstack.io/product_downloads/images/zstack-image.qcow2
    • FTP:
      • Anonymous format: ftp://hostname[:port]/path/file

        Example: ftp://172.20.0.10/pub/zstack-image.qcow2

      • Non-anonymous format: ftp://user:password@hostname[:port]/path/file

        Example: ftp://zstack:password@172.20.0.10/pub/zstack-image.qcow2

    • SFTP:
      • Format with password specified: sftp://user:password@hostname[:port]/path/file

        Example: sftp://root:password@172.20.0.10/pub/zstack-image.qcow2

      • Password-free format: sftp://user@hostname[:port]/path/file

        Example: sftp://root@172.20.0.10/pub/zstack-image.qcow2

    • The absolute path on backup storage, which supports SFTP backup storage and ImageStore.

      Example: file:///opt/zstack-dvd/zstack-image-1.4.qcow2

    Note:
    • Before you enter a URL, make sure that the URL can be accessed by a backup storage and the corresponding backup storage file exists.
    • Before you upload an image by using the SFTP password-free method, make sure that password-free SSH access can be achieved between a backup storage and the SFTP server.
    • Smooth, continuous display of progress bar, and breakpoint resume:
      • The ImageStore backup storage supports smooth, continuous display of progress bar, and breakpoint resume.
      • The Ceph backup storage supports smooth, continuous display of progress bar, but does not support breakpoint resume.
      • The SFTP backup storage does not support smooth, continuous display of progress bar, or breakpoint resume.
    • If you upload an image by using file:///, make sure that:
      • The Ceph backup storage currently does not support the file:/// format.
      • The file:/// path contains three forward slashes (/), which correspond to the absolute path of the backup storage. For example, file:///opt/zstack-dvd/zstack-image-1.4.qcow2. The zstack-image-1.4.qcow2 file needs to be stored in the /opt/zstack-dvd directory of the backup storage.
  2. Upload a local file: You can upload an image that can be accessed by your current browser. Both ImageStore and Ceph backup storages are supported.
    Note:

    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.

Image Operations

  • Enable:

    Enable the disabled images. These images can act as candidates used to create VM instances.

  • Disable:

    Disable images. These images cannot act as candidates used to create VM instances.

  • Export:

    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 to all:

    Share images to all accounts. Hence, all regular accounts and project users can use these images.

  • Share:

    Share images to one or more regular accounts or project users.

  • Recall from all:

    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:

    Recall images from the specified regular accounts and project users.

  • Change owner:

    Change the owners of the images to the regular accounts and project users.

  • Migrate storage:

    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:

    Delete images. To expunge or restore the images, delete them first.

  • Restore:

    Restore the deleted images to the running state.

  • Expunge:

    Expunge the deleted images. Then, the actual data on the backup storage will be deleted.

  • Download exported image:

    Download the exported images to the corresponding local disk via a browser.

  • Copy URL:

    Copy the URLs of the images, and add them to other clouds. Also, you can download these URLs by using wget directly.

  • Delete exported image:

    Remove the exported images from a backup storage. These images will no longer occupy storage capacities.

  • Change platform:

    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.

  • Change QGA option:

    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 capacity:

    Refresh the actual capacities of the backup storage where the images reside.

Notice

When you use an image, note the following:
  • The image URL that you entered must be accessible to backup storages, and contain this image. If the backup storages cannot access the URL, you will prompt for the image download failure.
  • If you select 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.
  • An admin can share this image to a regular account. After sharing, the regular account can create VM instances by using this image.
  • The regular account can create VM instances by either adding other images or using the image shared by the admin. The regular account can delete the images added by himself, but cannot delete the image shared by others.
  • After you stop the image, this image cannot act as a candidate used to create VM instances.
  • The image capacity is the virtual capacity, namely the virtual size of this image. The actual capacity of the image is the space of a backup storage occupied by this image, similar to the file size read by du -sm.
  • ImageStore images can be exported. After you export the images, you can download the images via URLs.
  • An image supports two types of BIOS mode: Legacy and UEFI. When you create VM instances, the BIOS mode in the image will be inherited to the VM instances. Exercise caution. Mismatch of the BIOS mode may lead to abnormalities of the VM instances.
    • Legacy: Support all operating systems. To ensure the usage stability, we recommend that you use the Legacy mode.
    • UEFI: Support two types of operating system, including Windows and CentOS. Specifically, Windows 7 and Windows Server 2008 R2 must use the Compatibility Support Module (CSM).
    • For a qcow2 image or raw image, select the BIOS mode that is consistent with the encapsulated image.
    • For an ISO image, select a BIOS mode as needed. The system will be installed in a wizard mode according to the BIOS mode that you selected.
    • If the VM instances that you created need to use the UEFI mode, we recommend that you select the corresponding VM image from the following list of operating system versions.
      Operating System BIOS Mode Supported Version
      Windows UEFI
      • Windows 8 or later versions
      UEFI (compatibility module)
      • Windows 7
      • Windows Server 2008 R2
      Linux UEFI
      • CentOS 7.2
      • CentOS 7.3
      • CentOS 7.4 or later versions
    • For a Linux image of CentOS 7.4 or later versions with the UEFI mode, after you restart a created VM instance, the VM instance will probably enter the UEFI Shell. To reboot successfully and enter the operating system, follow the methods below:
      • Method 1: Add a script to automatically skip the UEFI Shell and directly enter the operating system.
        In the operating system that you installed successfully, run 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
      • Method 2: Manually exit the UEFI Shell.
        If the VM instance already entered the UEFI Shell, you could manually run the following commands to exit the UEFI Shell:
        Shell> fs0: FS0:\> cd EFI FS0:\EFI\> cd centos FS0:\EFI\centos\> shimx64-centos.efi
    • For a Windows VM instance (such as Windows Server 2012 R2, Windows Server 2016, and Windows 10) with the UEFI mode, the following page will be displayed after the VM instance starts. Press any key to continue the installation of the VM operating system. Otherwise, the VM instance will enter the UEFI Shell, as shown in Press Any Key to Continue.
      Figure 1. Press Any Key to Continue


      If the VM instance already entered the UEFI Shell, you must run the following commands before you boot the operating system:
      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

Download

Already filled the basic info?Click here.

Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

An email with a verification code will be sent to you. Make sure the address you provided is valid and correct.

Download

Not filled the basic info yet? Click here.

Invalid email address or mobile number.

Email Us

contact@zstack.io
ZStack Training and Certification
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

Email Us

contact@zstack.io
Request Trial
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

Email Us

contact@zstack.io

The 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.

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder.
Or click on the URL below. (For Internet Explorer, right-click the URL and save it.)

Thank you for using ZStack products and services.

Submit successfully.

We'll connect soon.

Thank you for using ZStack products and services.