Document navigation

Upgrade Virtualization Components (Optional)

After upgrading the platform version, you can upgrade QEMU and Libvirt on hosts as needed to use the features and fixes provided by the new component versions.

  • The platform version upgrade is complete, and management services are running properly.
  • An ISO that matches the target platform version and the operating system of the current environment is available. This task uses the H84r ISO as an example.
  • A maintenance window has been scheduled. VMs need to use the new QEMU version after the upgrade. Plan downtime for the affected VMs in advance.
Note: Before upgrading a production environment, we recommend that you contact technical support to confirm the upgrade plan and related precautions.

Different platform versions may use different versions of QEMU and Libvirt. A platform version upgrade does not automatically update virtualization components on hosts. Perform this task for each cluster as needed.

Note: QEMU and Libvirt cannot be rolled back to an earlier version after the upgrade.
  1. Make sure the management node's local repository has been updated to the target version.
    If the local repository was updated with the corresponding ISO during the platform upgrade, you do not need to repeat this operation. Otherwise, log in to the management node and run the following command from the directory containing the ISO. If management node HA is configured, run the command on each management node.
    [root@localhost ~]# zstack-upgrade -r ZStack-ZSphere-x86_64-DVD-5.2.0-H84r.iso
  2. Back up the management node database.
    On the management node, run the following command to back up the database to the /var/lib/zstack/mysql-backup/ directory. If management node HA is configured, run the command on each management node.
    [root@localhost ~]# zstack-ctl dump_mysql --file-name zstack-db-backup-before-component-upgrade
  3. Check platform services and resource connection status.
    Make sure management services are running properly. In the management UI, check that the hosts to be upgraded and related storage resources are connected.
  4. Disable the VM HA policy.
    Log in to the ZSphere management UI and click Reliability > HA Policy. Record the current switch state and disable the HA policy. If it is already disabled, leave it disabled.
  5. Log in to the management node CLI.
    Log in to the management node and run the following commands. If management node HA is configured, run the commands on the management node where the VIP resides. You can use zsha2 status to identify this node. Replace ADMIN_PASSWORD with the actual password of the admin account.
    [root@localhost ~]# zstack-cli
    - >>> LogInByAccount accountName=admin password=ADMIN_PASSWORD
  6. Upgrade QEMU on hosts in the specified cluster.
    Query clusters in the CLI to obtain the UUID of the cluster to be upgraded. Replace CLUSTER_UUID with the actual cluster UUID and run the upgrade command.
    admin >>> QueryCluster
    admin >>> UpdateClusterOS updatePackages=qemu-kvm excludePackages=python2-crypto uuid=CLUSTER_UUID

    Record the UUID of the returned upgrade job. Replace LONG_JOB_UUID in the following command with this UUID to query the job status. Wait until state is Succeeded before continuing.

    admin >>> QueryLongJob uuid=LONG_JOB_UUID
  7. Upgrade Libvirt on hosts in the same cluster.
    1. Update the glib2 package required by Libvirt first.
      Replace CLUSTER_UUID with the UUID of the cluster to be upgraded and run the following command.
      admin >>> UpdateClusterOS updatePackages=glib2 uuid=CLUSTER_UUID

      Query the job status using the returned job UUID. Wait until state is Succeeded before upgrading Libvirt.

      admin >>> QueryLongJob uuid=LONG_JOB_UUID
    2. Upgrade Libvirt and wait for the upgrade job to complete.
      admin >>> UpdateClusterOS updatePackages=libvirt excludePackages=python2-crypto uuid=CLUSTER_UUID

      Query the job status using the UUID returned by this command. Wait until state is Succeeded.

      admin >>> QueryLongJob uuid=LONG_JOB_UUID
  8. Check the QEMU and Libvirt versions installed on the hosts.
    Log in to an upgraded host and run the following commands to confirm that the components have been updated to the target versions.
    [root@localhost ~]# qemu-img -V
    [root@localhost ~]# rpm -qa | grep libvirt

    To upgrade additional clusters, upgrade QEMU and Libvirt and check their versions in each cluster in sequence.

  9. Make the new QEMU version take effect for VMs.
    Log in to the management UI, shut down the affected VMs on the upgraded hosts, and then start them again. Check that the VMs and their workloads are running properly.
  10. Restore the VM HA policy to its previous state.
    If the HA policy was enabled before this task, click Reliability > HA Policy and enable it again after confirming that the environment and VM workloads are running properly. If it was previously disabled, leave it disabled.