Upgrade from 3.0.x to 3.0.2
Perform the following to upgrade from CloudStack 3.0.0 or 3.0.1 to CloudStack 3.0.2.
1. Stop all Usage Servers if running. Run this on all Usage Server hosts.
# service cloud-usage stop
2. Stop the Management Servers. Run this on all Management Server hosts.
# service cloud-management stop
3. On the MySQL master take a backup of the MySQL databases. We recommend performing this step even in test upgrades. If there is an issue this will assist with debugging.
In the following commands, it is assumed that you have set the root password on the database, which is a CloudStack recommended best practice. Substitute your own MySQL root password.
# mysqldump -u root -p<mysql_password> cloud > cloud-backup.dmp
# mysqldump -u root -p<mysql_password> cloud_usage > cloud-usage-backup.dmp
4. The resource count table may have duplicate entries which will cause the upgrade to fail. You need to drop those duplicate entries for the same resource type before starting the upgrade. Enter mysql, then run the following command:
mysql>delete from cloud.resource_count;
Exit mysql. You will generate a new resource count table later, in step 11.
5. Download the CloudStack Management Server version 3.0.2 onto each host where it will run from one of the following links. If your operating system is CentOS, use the download file for RHEL.
Open-source community: http://sourceforge.net/projects/cloudstack/files/CloudStack Acton/
Commercial customers: https://www.citrix.com/English/ss/downloads/
Commercial customers will need a MyCitrix account.
6. Upgrade the CloudStack packages. You should have a file in the form of “CloudStack-3.0.2-N-OSVERSION.tar.gz”. Untar the file and then run the install.sh script inside it. Replace the file and directory names below with those you are using:
# tar xzf CloudStack-3.0.2-N-OSVERSION.tar.gz
# cd CloudStack-3.0.2-N-OSVERSION
You should see a few messages as the installer prepares, followed by a list of choices.
7. Choose “U” to upgrade the packages.
8. Repeat steps 5 – 7 on each management server node.
9. Edit the file schema-301to302.sql. This file can be found under the cloud/setup directory. The exact location may vary depending on your operating system, but a typical path is /usr/share/cloud/setup/db/schema-301to302.sql. Comment out the following line:
DROP INDEX `i_host__allocation_state` ON `cloud`.`host`
10. Start one Management Server. Do not start the other Management Servers. # service cloud-management start
11. When the UI becomes accessible (at http://<your.management.server.ip>:8080/client), log in with the user ID “admin” and password “password.” Click Domains, then click the ROOT domain. Click the Update Resource Count button. This will refresh the resource count and generate the table deleted in step 4.
12. Start the other Management Servers. Perform this on each Management Server host.
# service cloud-management start
13. Start all Usage Servers (if they were running on your previous CloudStack version). Perform this on each Usage Server host. # service cloud-usage start
14. (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.
On each KVM host:
a. Copy the CloudStack 3.0.2 .tgz download to the host, untar it, and cd into the resulting directory.
b. Stop the running agent.
# service cloud-agent stop
c. Update the agent software.
Choose “U” to update the packages.
d. Start the agent. # service cloud-agent start
e. Insert a valid username and password into the host_details table for each KVM node. Substitute your own host ID, username, and password in the commands below and submit them to the MySQL server:
insert into cloud.host_details (host_id, name, value) VALUES (the-id-of-host, “username”, the-actual-host-user-name)
insert into cloud.host_details (host_id, name, value) VALUES (the-id-of-host, “password”, the-actual-host-password)
15. In the CloudStack Administrator UI, check the status of the hosts. All hosts should come to Up state (except those that you know to be offline). You may need to wait 20 or 30 minutes, depending on the number of hosts. Do not proceed to the next step until the hosts show in Up state. If the hosts do not come to the Up state, contact support.
16. Stop, then start, all Secondary Storage VMs, Console Proxy VMs, and virtual routers. A script is provided to implement this. Run the script once on one management server. The script requires the IP address of the MySQL instance, the MySQL user to connect as, and the password to use for that user. In addition to those parameters, provide the “-a” argument. For example:
# nohup cloud-sysvmadm -d 192.168.1.5 -u cloud -p password -a > sysvm.log 2>&1 &
# tail -f sysvm.log
This might take up to an hour to run, depending on the number of accounts in the system.
17. To verify the upgrade was successful, you can run the following commands.
a. Check for CloudStack packages.
# rpm -qa | grep -i cloud
The expected output is like the following:
b. Start MySQL and get the CloudStack version.
mysql> select * from cloud.version order by id desc limit 1;
The expected output is like the following:
| id ? ?| version| updated ? ? ? ? ? ? ? ? ?| step ? ? ? ?|
| 2 ? ? | 3.0.2 ? ? | 2012-04-23 06:42:06 | Complete |
1 row in set (0.00 sec)