Upgrade Instruction from 4.9.x
Any steps that are hypervisor-specific will be called out with a note.
We recommend reading through this section once or twice before beginning your upgrade procedure, and working through it on a test system before working on a production system.
Note
The following upgrade instructions should be performed regardless of hypervisor type.
Upgrade Steps:
- Backup CloudStack database (MySQL)
- Add package repository for MySQL connector
- Upgrade CloudStack management server(s)
- Update hypervisors specific dependencies
While running the existing 4.9.x system, log in to the UI as the root administrator.
In the left navigation bar, click Templates.
In Select view, click Templates.
Click Register template. The Register template dialog box is displayed.
In the Register template dialog box, specify the following values (do not change these):
Watch the screen to be sure that the template downloads successfully and enters the READY state. Do not proceed until this is successful.
Packages repository
Most users of CloudStack manage the installation and upgrades of CloudStack with one of Linux’s predominant package systems, RPM or APT. This guide assumes you’ll be using RPM and Yum (for Red Hat Enterprise Linux or CentOS), or APT and Debian packages (for Ubuntu).
Create RPM or Debian packages (as appropriate) and a repository from the 4.11.3.0 source, or check the Apache CloudStack downloads page at for package repositories supplied by community members. You will need them for Management Server on Ubuntu or and Hypervisor: KVM hosts upgrade.
Instructions for creating packages from the CloudStack source are in the .
Database Preparation
Backup current database
Stop your management server or servers. Run this on all management server hosts:
If you are running a usage server or usage servers, stop those as well:
Make a backup of your MySQL database. If you run into any issues or need to roll back the upgrade, this will assist in debugging or restoring your existing environment. You’ll be prompted for your password.
$ mysqldump -u root -p cloud > cloud-backup_`date '+%Y-%m-%d'.sql
$ mysqldump -u root -p cloud_usage > cloud_usage-backup_`date '+%Y-%m-%d'.sql
(KVM Only) If primary storage of type local storage is in use, the path for this storage needs to be verified to ensure it passes new validation. Check local storage by querying the cloud.storage_pool table:
If local storage paths are found to have a trailing forward slash, remove it:
$ mysql -u cloud -p -e 'update cloud.storage_pool set path="/var/lib/libvirt/images" where path="/var/lib/libvirt/images/"';
If you are using Ubuntu, follow this procedure to upgrade your packages. If not, skip to step .
Note
Community Packages: This section assumes you’re using the community supplied packages for CloudStack. If you’ve created your own packages and APT repository, substitute your own URL for the ones used in these examples.
The first order of business will be to change the sources list for each system with CloudStack packages. This means all management servers, and any hosts that have the KVM agent. (No changes should be necessary for hosts that are running VMware or Xen.)
Java 8 JRE on Ubuntu
CloudStack 4.11 requires installation of Java 8 JRE from an external PPA such as openjdk-r for Ubuntu distributions where the openjdk-8 packages are not available from the main repositories such as on Ubuntu 14.04. The PPA can be added before installation/upgrade:
Users can also choose to install Java 8 distribution from Oracle, or OpenJDK distribution from Azul.
Start by opening /etc/apt/sources.list.d/cloudstack.list
on any systems that have CloudStack packages installed.
This file should have one line, which contains:
deb http://download.cloudstack.org/ubuntu precise 4.8
We’ll change it to point to the new package repository:
deb http://download.cloudstack.org/ubuntu precise 4.9
Setup the public key for the above repository:
wget -qO - http://download.cloudstack.org/release.asc | sudo apt-key add -
If you’re using your own package repository, change this line to read as appropriate for your 4.11 repository.
Now update your apt package list:
$ sudo apt-get update
Now that you have the repository configured, it’s time to upgrade the
cloudstack-management
package.$ sudo apt-get upgrade cloudstack-management
If you use CloudStack usage server
$ sudo apt-get upgrade cloudstack-usage
Management Server on CentOS/RHEL
If you are using CentOS or RHEL, follow this procedure to upgrade your packages. If not, skip to hypervisors section .
Community Packages: This section assumes you’re using the community supplied packages for CloudStack. If you’ve created your own packages and yum repository, substitute your own URL for the ones used in these examples.
Starting with 4.9.0, cloudstack-management RPM’s now depend on the mysql-connector-python
package. Therefore Apache CloudStack 4.11.3.0 requires the instalation of the MySQL connector on CentOS.
MySQL connector RPM repository
Add a new yum repo /etc/yum.repos.d/mysql.repo
:
[mysql-community]
name=MySQL Community connectors
baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/$releasever/$basearch/
gpgcheck=1
Import GPG public key from MySQL:
Install mysql-connector
yum install mysql-connector-python
The first order of business will be to change the yum repository for each system with CloudStack packages. This means all management servers, and any hosts that have the KVM agent.
(No changes should be necessary for hosts that are running VMware or Xen.)
Start by opening /etc/yum.repos.d/cloudstack.repo
on any systems that have CloudStack packages installed.
This file should have content similar to the following:
[apache-cloudstack]
name=Apache CloudStack
baseurl=http://download.cloudstack.org/centos/6/4.8/
enabled=1
gpgcheck=0
If you are using the community provided package repository, change the base url to:
http://download.cloudstack.org/centos/$releasever/4.11/
Setup the GPG public key if you wish to enable gpgcheck=1
:
rpm --import http://download.cloudstack.org/RPM-GPG-KEY
If you’re using your own package repository, change this line to read as appropriate for your 4.11 repository.
Now that you have the repository configured, it’s time to upgrade the
cloudstack-management
.$ sudo yum upgrade cloudstack-management
If you use CloudStack usage server
$ sudo yum upgrade cloudstack-usage
(XenServer only) Copy vhd-utils file on CloudStack management servers. Copy the file to /usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver
.
wget -P /usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver http://download.cloudstack.org/tools/vhd-util
Hypervisor: VMware
Warning
For VMware hypervisor CloudStack management server packages must be build using “noredist”. Refer to
(VMware only) Additional steps are required for each VMware cluster. These steps will not affect running guests in the cloud. These steps are required only for clouds using VMware clusters:
Stop the Management Server:
$ sudo service cloudstack-management stop
Generate the encrypted equivalent of your vCenter password:
Store the output from this step, we need to add this in cluster_details table and vmware_data_center tables in place of the plain text password
Find the ID of the row of cluster_details table that you have to update:
$ mysql -u <username> -p<password>
Update the plain text password with the encrypted one
update cloud.cluster_details set value = '_ciphertext_from_step_1_'
where id = _id_from_step_2_;
Confirm that the table is updated:
Find the ID of the correct row of vmware_data_center that you
want to update
select * from cloud.vmware_data_center;
update the plain text password with the encrypted one:
update cloud.vmware_data_center set password = '_ciphertext_from_step_1_'
where id = _id_from_step_5_;
Confirm that the table is updated:
select * from cloud.vmware_data_center;
Hypervisor: KVM
(KVM only) Additional steps are required for each KVM host. These steps will not affect running guests in the cloud. These steps are required only for clouds using KVM as hosts and only on the KVM hosts.
Configure the as detailed above.
Stop the running agent.
$ sudo service cloudstack-agent stop
Update the agent software.
$ sudo apt-get upgrade cloudstack-agent
Verify that the file
/etc/cloudstack/agent/environment.properties
has aline that reads:
paths.script=/usr/share/cloudstack-common
If not, add the line.
Start the agent.
$ sudo service cloudstack-agent start
For KVM hosts, upgrade the cloudstack-agent
package
Configure the CloudStack RPM repository as detailed above.
$ sudo yum upgrade cloudstack-agent
Verify that the file
/etc/cloudstack/agent/environment.properties
has a line that reads:paths.script=/usr/share/cloudstack-common
If not, add the line.
Restart the agent:
$ sudo service cloudstack-agent stop
$ sudo killall jsvc
$ sudo service cloudstack-agent start
-
$ sudo service cloudstack-management start