注意

4.4.2 是目前最新的版本;

  4.2.x版本升级说明

本节将引导你从 CloudStack 4.2.x 升级到CloudStack4.4.x

如果您在升级过程中遇到任何问题,请随时提问 或者 .

警告

 realhostip.com DNSSSL证书

realhostip.com动态DNS解析服务正在今年夏天正式退出。所以CloudStack4.3.0之后的版本不再使用realhostip.com DNS域或SSL证书来加密控制台代理或文件副本通信。.

虚拟机管理程序升级需要注意任何步骤的操作;

我们建议在您升级操作之前多阅读几次操作说明;也一定要在测试环境多测试几次在应用到生产环境系统上;

注意

以下的升级说明也考虑到管理程序的虚拟路类别;

升级步骤:

1.    安装注册新的System-VM 模板

2.    备份CloudStack 数据库 (MySQL)

3.    升级CloudStack 管理服务器

4.    更新虚拟化程序特定的依赖包

5.    重新启动系统VM和虚拟路由(Virtual-Routers

软件包库

大多数用户使用cloudstack主要是用Linux封装RPMAPT进行CloudStack的安装和升级。本指南假定你将使用RPMyum(用于Red Hat Enterprise LinuxCentOS的),或APTDebian软件包(Ubuntu的)。

 

4.4源代码创建RPMDebian软件包(视情况而定)和一个软件包仓库,或者检查Apache CloudStack下载页面http://cloudstack.apache.org/downloads.html为社区成员提供的包库。你需要确定它们是Ubuntu管理服务器还是CentOS/ RHEL管理服务器和虚拟化技术进行KVM主机升级。

CloudStack软件包仓库说明在CloudStack安装指南中。

更新系统VM 模板

注意

升级到4.3 或者 4.4.1 需要下载这两个相关的系统模板;

1、在现在的4.2.x版本中、以root用户进行登录管理

2、在左侧导航栏中,单机模板

3、选择模板视图

4、点击注册4.3系统VM模板;

a)    点击注册模板

将显示模板对话框

b)    在显示模板对话框将显示下列值(不要更改这些值):

虚拟化

概述

XenServer

Name: systemvm-xenserver-4.3

Description:  systemvm-xenserver-4.3

URL: 

Zone: Choose the zone where  this hypervisor is used

Hypervisor: XenServer

Format: VHD

OS Type: Debian GNU/Linux 7.0  (64-bit) (or the highest Debian release number available in the dropdown)

Extractable: no

Password Enabled: no

Public: no

Featured: no

Routing: no

KVM

Name: systemvm-kvm-4.3

Description: systemvm-kvm-4.3

URL: 

Zone: Choose the zone where  this hypervisor is used

Hypervisor: KVM

Format: QCOW2

OS Type: Debian GNU/Linux 7.0  (64-bit) (or the highest Debian release number available in the dropdown)

Extractable: no

Password Enabled: no

Public: no

Featured: no

Routing: no

VMware

Name: systemvm-vmware-4.3

Description:  systemvm-vmware-4.3

URL: 

Zone: Choose the zone where  this hypervisor is used

Hypervisor: VMware

Format: OVA

OS Type: Debian GNU/Linux 7.0  (64-bit) (or the highest Debian release number available in the dropdown)

Extractable: no

Password Enabled: no

Public: no

Featured: no

Routing: no

5、注册4.4系统VM模板

a)    注册下载模板

将显示模板对话框

b)    在显示模板对话框将显示下列值(不要更改这些值):

虚拟化

概述

XenServer

Name: systemvm-xenserver-4.4

Description:  systemvm-xenserver-4.4

URL: 

Zone: Choose the zone where  this hypervisor is used

Hypervisor: XenServer

Format: VHD

OS Type: Debian GNU/Linux 7.0  (64-bit) (or the highest Debian release number available in the dropdown)

Extractable: no

Password Enabled: no

Public: no

Featured: no

Routing: no

KVM

Name: systemvm-kvm-4.4

Description: systemvm-kvm-4.4

URL: 

Zone: Choose the zone where  this hypervisor is used

Hypervisor: KVM

Format: QCOW2

OS Type: Debian GNU/Linux 7.0  (64-bit) (or the highest Debian release number available in the dropdown)

Extractable: no

Password Enabled: no

Public: no

Featured: no

Routing: no

VMware

Name: systemvm-vmware-4.4

Description:  systemvm-vmware-4.4

URL: 

Zone: Choose the zone where  this hypervisor is used

Hypervisor: VMware

Format: OVA

OS Type: Debian GNU/Linux 7.0  (64-bit) (or the highest Debian release number available in the dropdown)

Extractable: no

Password Enabled: no

Public: no

Featured: no

Routing: no

6、查看确认模板下载成功转化是就绪状态;

 

数据库准备

备份当前数据库

1、停止管理服务、在management主机中运行命令:

$ sudo service cloudstack-management stop

2、如果有运行的usage服务或者可以先停止服务;

$ sudo service cloudstack-usage stop

3、对Mysql数据库做备份如果你遇到任何问题或需要回滚升级这将协助或恢复您的现有环境. 按系统提示输入密码;

$ 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

4(KVM) 如果是使用本地存储是作为主存储的该存储路径需要确认可以通过验证cloud.storage_pool 表查询本地存储信息

$mysql -u cloud -p -e "select id,name,path fromcloud.storage_pool where pool_type='Filesystem'"

a)、如果本地存储的路径最后结尾带有一个”/”  则移除:

$ mysql -u cloud -p -e 'update cloud.storage_pool setpath="/var/lib/libvirt/p_w_picpaths" wherepath="/var/lib/libvirt/p_w_picpaths/"';

Ubuntu 下管理服务器

如果你使用的是Ubuntu;则要遵循下列的步骤进行升级操作,如果不是可以直接跳至Centos/EHRL下的管理服务再进行操作

注意

CommunityPackages本节假设你在使用cloudstack社区提供的CloudStack软件包库.再如果你创建了自己的软件包库和yum源,在如下面例子中你可以更换自己的URL路径

第一步做的就是为了配置所有的Cloudstack主机仓库源列表包括所有的management主机和kvm主机 (运行VMwareXen虚拟化的主机则不需要更改 )

CloudStack apt

首先在任何需要安装cloudstack软件包的系统打开

/etc/apt/sources.list.d/cloudstack.list

这个文件应该包含一行如下信息:

deb http://cloudstack.apt-get.eu/ubuntu precise 4.2

我们将更改为新的软件包库

deb http://cloudstack.apt-get.eu/ubuntu precise 4.4

如果你使用你自己的包库,改变这一行改为适合您的4.4库。

1、现在更新apt包列表

$ sudo apt-get update

2、现在配置好了软件包库接下来可以安装 cloudstack-management依赖包.

$ sudo apt-get upgrade cloudstack-management

3、如果你用到了cloudstackusage 服务

$ sudo apt-get upgrade cloudstack-usage

 

CentOS/RHEL系统上的管理服务

如果你正在使用的CentOSRHEL,请按照以下步骤升级包。如果没有,请跳至管理程序部分,然后系统VM和虚拟路由器。

注意

CommunityPackages本节假设你在使用cloudstack社区提供的CloudStack软件包库.再如果你创建了自己的软件包库和yum在如下面例子中你可以更换自己的URL路径

CloustStack RPM 包库

第一步做的就是为了配置所有的Cloudstack主机仓库源列表包括所有的management主机和kvm主机 

(运行VMwareXen虚拟化的主机则不需要更改 )

在任何安装cloudstack服务的系统上先打开 /etc/yum.repos.d/cloudstack.repo 

这个YUM源会类似于如下文件

[apache-cloudstack]

name=Apache CloudStack

baseurl=http://cloudstack.apt-get.eu/rhel/4.2/

enabled=1

gpgcheck=0

如果你在使用社区提供的软件包仓库, 则可以改变基础URL

http://cloudstack.apt-get.eu/rhel/4.4/

如果你使用你自己的包库,改变这一行改为适合您的4.4.

1、现在已经配置YUM库进行升级 cloudstack-management.

$ sudo yum upgrade cloudstack-management

2、如果有使用的cloudstack-usage则也进行升级;

$ sudo yum upgrade cloudstack-usage

 

虚拟化: Xen/XenServer

(XenServer) cloudstack管理服务器山复制 vhd-utils ,复制 vhd-utils  /usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver

wget -P/usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver \

 

虚拟化: VMware

警告

对于VMware的虚拟化管理的CloudStack服务器软件包必须搭建“noredist”;可以从源代码构建。

(VMware)  VMware集群需要做额外的操作.这些步骤不会影响云中正在运行的虚拟机. 这些步骤只针对云环境中使用的 VMware集群:

1、停止管理服务

$ sudo service cloudstack-management stop

2、生成加密后的VCenter密码

$ java -classpath/usr/share/cloudstack-common/lib/jasypt-1.9.0.jarorg.jasypt.intf.cli.JasyptPBEStringEncryptionCLI encrypt.sh input="_your_vCenter_password_"password="`cat/etc/cloudstack/management/key`"verbose=false

保存此步骤的输出, 我们需要将其替换cluster_detailsvmware_data_center中的明文密码

4、找到 cluster_details 表中需要被更新的ID:

$ mysql -u <username> -p<password>

> select * from cloud.cluster_details;

5、明文密码被更新为加密密码

> update cloud.cluster_details set value='_ciphertext_from_step_1_' where id= _id_from_step_2_;

6、确认下列表被更新为:

> select * from cloud.cluster_details;

7、查找vmware_data_center表中需要被更的ID

> select * from cloud.vmware_data_center;

8、更新明文密码为加密密码

> update cloud.vmware_data_center set password='_ciphertext_from_step_1_' where id= _id_from_step_5_;

9、确认下列表的更新

> select * from cloud.vmware_data_center;

 

虚拟化: KVM

KVM on Ubuntu

(KVM)每一个KVM主机都需要额外的操作步骤;这些步骤不会影响云中运转的来宾主机的状态,这些步骤只是对环境中的KVM 主机

1、以上有详细的配置cloudstack软件库

2、停止运行的agent.

$ sudo service cloudstack-agent stop

3、更新agent软件

$ sudo apt-get upgrade cloudstack-agent

4、在/etc/cloudstack/agent/environment.properties 验证文件中有这样一行

paths.script=/usr/share/cloudstack-common

如果没有就添加上;

 

5、启动agent.

$ sudo service cloudstack-agent start

 

KVM on CentOS/RHEL

对于KVM主机,需要更新 cloudstack-agent 软件包

1、配置CloustStack RPM   软件包在上面都有说明;

$ sudo yum upgrade cloudstack-agent

2、在/etc/cloudstack/agent/environment.properties 验证文件中有这样一行

paths.script=/usr/share/cloudstack-common

如果没有请加上

3、重新启动agent:

$ sudo service cloudstack-agent stop

$ sudo killall jsvc

$ sudo service cloudstack-agent start

重启cloudstack-management管理服务

1、现在重新启动managementserver

$ sudo service cloudstack-management start

2、再次重新启动usageserver

$ sudo service cloudstack-usage start

 

系统VM 和虚拟路由器

System-VMs and Virtual-Routers

一旦你升级了管理服务器的软件包库之后,你需要重启系统虚拟机;确保使用全局变量 “integration.api.port” 将管理端口设置为8096。因为在升级结束后cloud-sysvmadm会使用到这个端口。

关于如何设置参数;请看 “Setting Global Configuration Parameters” 这个安装指南, 更改这个参数后需要重新启动管理服务;还要确认的是本地防火墙中需要开放8096 这个端口。

这边有个脚本可以帮助你做这些,而运行这个脚本需要提供Mysql实例主机IP 和认证信息;

# nohup cloudstack-sysvmadm -dIPaddress -u cloud -p password -a > sysvm.log 2>&1 &

你可以监控该日志的进程,但是系统VM 重启需要花费一些时间;

# tail -f sysvm.log

输出的 sysvm.log 会出现类似下面的信息:

Stopping and starting 1 secondary storage vm(s)...

Done stopping and starting secondary storage vm(s)

Stopping and starting 1 console proxy vm(s)...

Done stopping and starting console proxy vm(s).

Stopping and starting 4 running routing vm(s)...

Done restarting router(s).

 

(注释:

原文链接地址 http://docs.cloudstack.apache.org/projects/cloudstack-release-notes/en/4.4.1/upgrade/upgrade-4.2.html