Upgrading XenServer Versions
This section tells how to upgrade XenServer software on CloudStack hosts. The actual upgrade is described in XenServer documentation, but there are some additional steps you must perform before and after the upgrade. The following upgrades are supported:
XenServer 5.6 to XenServer 5.6 FP1
XenServer 5.6 to XenServer 5.6 SP2
XenServer 5.6 FP1 to XenServer 5.6 SP2
1. Upgrade the database. On the Management Server node:
a. Stop the management server and usage server:
# service cloud-usage stop
# service cloud-management stop
b. Back up the database. In the following commands, it is assumed that you have set the root password on the database, which is a CloudStack recommended best practice.
# mysqldump -h <management-server-IPaddress> -u cloud -p cloud> cloud.backup.sql Enter password: <enter>
# mysqldump –user=root -p –databases cloud_usage > cloud_usage.backup.sql Enter password: <enter>
c. Upgrade the database (enter the command all on one line): # mysql -h <management-server-IPaddress> -u cloud -p cloud < /usr/lib64/cloud/agent/scripts/vm/hypervisor/xenserver/xenserver56toxenserver56fp1.sql Enter password: <enter>
d. Restart the management server and usage server: # service cloud-management start # service cloud-usage start
Note: you only need to do this once for all clusters.
2. Disconnect the XenServer cluster from CloudStack.
a. Log in to the CloudStack UI as root.
b. Navigate to the XenServer cluster, and click Actions ? Unmanage.
c. Watch the cluster status until it shows Unmanaged.
3. Log in to one of the hosts in the cluster, and run this command to clean up the VLAN:
# . /opt/xensource/bin/cloud-clean-vlan.sh
4. Still logged in to the host, run the upgrade preparation script:
# /opt/xensource/bin/cloud-prepare-upgrade.sh
Troubleshooting: If you see the error “can’t eject CD,” log in to the VM and umount the CD, then run the script again.
5. Upgrade the XenServer software on all hosts in the cluster. Upgrade the master first.
a. Live migrate all VMs on this host to other hosts. See the instructions for live migration in the Administrator’s Guide.
Troubleshooting: You might see the following error when you migrate a VM:
[root@xenserver-qa-2-49-4 ~]# xe vm-migrate live=true host=xenserver-qa-2-49-5 vm=i-2-8-VM You attempted an operation on a VM which requires PV drivers to be installed but the drivers were not detected.
vm: b6cf79c8-02ee-050b-922f-49583d9f1a14 (i-2-8-VM)
To solve this issue, run the following:
# /opt/xensource/bin/make_migratable.sh b6cf79c8-02ee-050b-922f-49583d9f1a14
b. Reboot the host.
c. Upgrade to the newer version of XenServer (5.6 FP1 or SP2). Use the steps in XenServer documentation.
d. After the upgrade is complete, copy the following files from the management server to this host, in the directory locations shown in the following table.
Copy this Management Server file… :?…to this location on the XenServer host
/usr/lib64/cloud/agent/scripts/vm/hypervisor/xenserver/xenserver56fp1/NFSSR.py :?/opt/xensource/sm/NFSSR.py
/usr/lib64/cloud/agent/scripts/vm/hypervisor/xenserver/xenserver56fp1/nfs.py :?/opt/xensource/sm/nfs.py
/usr/lib64/cloud/agent/scripts/vm/hypervisor/xenserver/setupxenserver.sh :?/opt/xensource/bin/setupxenserver.sh
/usr/lib64/cloud/agent/scripts/vm/hypervisor/xenserver/make_migratable.sh :?/opt/xensource/bin/make_migratable.sh
/usr/lib64/cloud/agent/scripts/vm/hypervisor/xenserver/cloud-clean-vlan.sh :?/opt/xensource/bin/cloud-clean-vlan.sh
e. Run the following script: # /opt/xensource/bin/setupxenserver.sh
f. Plug in the storage repositories (physical block devices) to the XenServer host:
# for pbd in `xe pbd-list currently-attached=false| grep ^uuid | awk ‘{print $NF}’`; do xe pbd-plug uuid=$pbd ; done
6. Repeat these steps to upgrade every host in the cluster to the same version of XenServer.
7. Run the following command on one host in the XenServer cluster to clean up the host tags:
# for host in $(xe host-list | grep ^uuid | awk ‘{print $NF}’) ; do xe host-param-clear uuid=$host param-name=tags; done;
8. Reconnect the XenServer cluster to CloudStack.
a. Log in to the CloudStack UI as root.
b. Navigate to the XenServer cluster, and click Actions ? Manage.
c. Watch the status to see that all the hosts come up.
9. After all hosts are up, run the following on one host in the cluster: # /opt/xensource/bin/cloud-clean-vlan.sh