把云并行迁移到 Red Hat Enterprise Linux OpenStack Platform 6 (Juno)
1. 并行云迁移
-
Deploying OpenStack: Learning Environments (Manual Set Up) (manual installation for instructional purposes)
-
Deploying OpenStack: Proof-of-Concept Environments (Packstack) (Packstack procedures for an all-in-one installation)
-
Deploying OpenStack: Enterprise Environments (Red Hat Enterprise Linux OpenStack Platform Installer) guides
2. 升级前需要在 RHEL 6 环境中进行的准备
-
应用程序数据 所有 OpenStack 应用程序数据(MySQL 数据库存储、Block Storage 卷、镜像)都需要保存在一个专门的本地设备中;或保存在由一个远程服务器提供的文件系统或卷中。请确定这些数据不会在进行 RHEL 7 安装时被覆盖。如果这些数据无法在升级的过程中被保留,请首先对它们进行一个备份。一个简单的方法是从另外一个系统上挂载一个 NFS 共享,把应用程序数据复制到其中:
#mkdir -p BACKUP/var/lib/{glance,nova,mysql}/#rsync -a /var/lib/mysql/ BACKUP/var/lib/mysql/#rsync -a /var/lib/glance/ BACKUP/var/lib/glance/#rsync -a /var/lib/nova/ BACKUP/var/lib/nova/备注
在本文档中,BACKUP 代表挂载的备份目录。 -
配置文件 您需要完全备份 OpenStack 配置文件,包括
/etc目录中的所有内容、/root以及其它本地用户的家目录中的验证信息(如 Identity、MySQL 等的验证信息)。如需了解更多与每个服务的配置选项相关的信息,请参阅 Configuration Reference(https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux_OpenStack_Platform/)。 -
主机名和地址 为了简化升级的过程,这里所介绍的内容需要您的新 RHEL 7 主机的 IP 地址和主机名与 RHEL 6 主机的相同。您可以:
-
为 RHEL 6 主机分配新的 IP 地址,从而可以把原来的 IP 地址分配给 RHEL 7 主机。这可以确保继续访问您的 controller 中的配置文件和其它数据,但是您需要额外的硬件来设置新主机。
-
您可以在 RHEL 6 主机上直接安装 RHEL 7。这将不需要额外的硬件,但您需要确保已经备份了所有配置文件和其它数据。
-
-
如果您使用 Cinder LVM 后端 在进行升级操作前断开所有 Block Storage 卷。RHEL7 包括了新的 LIO iSCSI 后端来替换 RHEL 6 中的 TGT 后端,这意味着 iSCSI 目标配置不会在升级的过程中被保留。
备注
如果您通过 Red Hat Enterprise Linux OpenStack Installer 使用自动的应答文件(answer file)进行安装,把卷设置为离线状态可能并不足以保证数据不会丢失,您需要确保相关的映射对本地 Block Storage LVM 进行了保护。
3. 配置 Configure Content Delivery Network(CDN)频道
备注
-
Red Hat OpenStack 1.0 (Essex) -- rhel-server-ost-6-preview-rpms
-
Red Hat OpenStack 2.1 (Folsom) -- rhel-server-ost-6-folsom-rpms
-
Red Hat Enterprise Linux OpenStack Platform 3 (Grizzly) -- rhel-server-ost-6-3-rpms
-
Red Hat Enterprise Linux OpenStack Platform 4 Beta (Havana) -- rhel-6-server-openstack-beta-rpms
-
Red Hat Enterprise Linux OpenStack Platform 4 (Havana) -- rhel-6-server-openstack-4.0-rpms
-
Red Hat Enterprise Linux OpenStack Platform 5 (Icehouse) -- rhel-7-server-openstack-5.0-rpms
备注
#subscription-manager repos \--enable=rhel-7-server-rh-common-rpms
3.1. Content Delivery Network (CDN) 频道
#subscription-manager repos --enable=[reponame]
#subscription-manager repos --disable=[reponame]
下表包括了 Red Hat Enterprise Linux 7 的频道。
表 1. 所需的频道
| 频道 | 软件仓库名 |
|---|---|
| Red Hat Enterprise Linux 7 Server (RPMS) |
rhel-7-server-rpms
|
| Red Hat OpenStack 6.0 for Server 7 (RPMS) |
rhel-7-server-openstack-6.0-rpms
|
| Red Hat Enterprise Linux 7 Server - RH Common (RPMs) |
rhel-7-server-rh-common-rpms
|
下表包括了 Red Hat Enterprise Linux OpenStack Platform installer 的频道。
表 3. 所需频道
| 频道 | 软件仓库名 |
|---|---|
| Foreman-RHEL-7 |
rhel-7-server-openstack-6.0-installer-rpms
|
| Red Hat Enterprise Linux 7 Server (RPMS) |
rhel-7-server-rpms
|
| Red Hat Software Collections RPMs for Red Hat Enterprise Linux 7 Server |
rhel-server-rhscl-7-rpms
|
| Images on CDN (Optional) |
rhel-7-server-openstack-6.0-files
|
为了使 Red Hat Enterprise Linux OpenStack Platform 6 可以正常工作,请禁用下表中的频道。
表 4. 禁用频道
| 频道 | 软件仓库名 |
|---|---|
| Red Hat CloudForms Management Engine |
"cf-me-*"
|
| Red Hat CloudForms Tools for RHEL 6 |
"rhel-6-server-cf-*"
|
| Red Hat Enterprise Virtualization |
"rhel-6-server-rhev*"
|
| Red Hat Enterprise Linux 6 Server - Extended Update Support |
"*-eus-rpms"
|
4. 升级 Controller 节点
步骤 1. 升级 Controller 节点
-
部署 RHEL 7 controller 节点
-
在一组新服务器上部署 RHEL 7,安装相应的软件包来恢复基本系统配置(接口定义、存储关联等):
#yum install -y \openstack-selinux \openvswitch -
激活 openvswitch 服务:
#systemctl enable openvswitch#systemctl start openvswitch -
如果您现在使用 LVM 作为 Block Storage 服务的后端,则还需要安装并激活用于管理 LIO 子系统的 targetcli 软件包:
#yum -y install targetcli#systemctl enable target#systemctl start target -
激活包括您的 Block Storage 卷的 LVM 卷组:
#vgchange -ay
-
-
恢复网络配置
-
恢复 OpenStack Networking 所需要的
/etc/sysconfig/network-scripts中的文件,如ifcfg-br-ex:#cp BACKUP/etc/sysconfig/network-scripts/ifcfg-br-ex \/etc/sysconfig/network-scripts/ifcfg-br-ex -
激活该接口:
#ifup br-ex
-
-
恢复 iptables 规则设置
-
把您在 RHEL6 controller 节点中定义的所有本地防火墙配置导入到 RHEL7 controller 节点中。您需要把 RHEL 6 主机中的
/etc/sysconfig/iptables复制到 RHEL 7 主机的/etc/sysconfig/iptables。 -
安装
iptables-services软件包:#yum install -y iptables-services -
停止
iptables服务:#systemctl stop iptables -
从备份中恢复您的
iptables设置:#cp BACKUP/etc/sysconfig/iptables /etc/sysconfig/iptables -
激活
iptables服务:#systemctl enable iptables#systemctl start iptables
-
-
安装
rabbitmq-server-
安装
rabbitmq-server软件包:#yum install -y rabbitmq-server -
从您的 RHEL 6 controller 上把
rabbitmq配置文件迁移到 RHEL7 controller 中的/etc/rabbitmq:#rsync -a BACKUP/etc/rabbitmq/ /etc/rabbitmq -
激活
rabbitmq-server服务:#systemctl enable rabbitmq-server#systemctl start rabbitmq-server
-
-
安装
mariadb-server-
安装
mariadb-server软件包:#yum install -y mariadb-server -
重新挂载
/var/lib/mysql目录(并相应修改/etc/fstab),或从备份中恢复/var/lib/mysql的内容:#rsync -a BACKUP/var/lib/mysql/ /var/lib/mysql/ -
如果存在,从您的备份中恢复
/root/.my.conf文件:#cp BACKUP/root/.my.cnf /root/.my.cnf -
为
/var/lib/mysql中的文件设置正确的所有者权限:#chown -R mysql:mysql /var/lib/mysql#fixfiles restore /var/lib/mysql/ -
激活
mariadb服务:#systemctl enable mariadb#systemctl start mariadb -
执行所需的数据库更新:
#mysql_upgrade确认可以通过mysql命令行客户端访问到数据库服务器。如果可以正常访问,它的输出应该和以下类似:#mysqlWelcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 419 Server version: 5.5.40-MariaDB MariaDB Server Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>
-
-
安装 Identity 服务
-
安装
openstack-keystone软件包:#yum install -y openstack-keystone -
把 Identity 服务配置文件从 RHEL6 controller 复制到 RHEL7 controller 的
/etc/keystone中:#rsync -a BACKUP/etc/keystone/ /etc/keystone/ -
升级 Identity 服务数据库 schema:
#sudo -u keystone keystone-manage db_sync -
激活 Identity 服务:
#systemctl enable openstack-keystone#systemctl start openstack-keystone -
加载 Identity 服务的管理身份认证并检查 Identity 是否在正常运行:
#. /root/keystonerc_admin#keystone endpoint-list
备注
以下步骤假设您的 Identity 服务身份验证信息已经被加载到环境中。 -
-
安装 Block Storage 服务
-
安装
openstack-cinder软件包:#yum install -y openstack-cinder -
把 Block Storage 配置文件从 RHEL6 controller 复制到 RHEL7 controller 的
/etc/cinder中:#rsync -a BACKUP/etc/cinder/ /etc/cinder/备注
如果您现在使用 LVM 后端,则需要更新cinder.conf文件来使用新的 LIO 驱动。请编辑/etc/cinder/cinder.conf的以下内容:[DEFAULT]
iscsi_helper=lioadm -
升级 Block Storage 数据库 schema:
#sudo -u cinder cinder-manage db sync -
激活 Block Storage 服务:
#systemctl enable openstack-cinder-{api,volume,scheduler}#systemctl start openstack-cinder-{api,volume,scheduler} -
确认 Block Storage API 可以正常工作,卷可以被使用:
#cinder list
-
-
安装 Image 服务
-
安装
openstack-glance软件包:#yum install -y openstack-glance -
把 Image 服务配置文件从 RHEL6 controller 复制到 RHEL7 controller 的
/etc/glance中:#rsync -a BACKUP/etc/glance/ /etc/glance/ -
升级 Image 服务数据库 schema:
#sudo -u glance glance-manage db sync -
使 Image 服务的日志和数据目录有正确的所有者权限设置:
#chown -R glance:glance /var/lib/glance#fixfiles restore /var/lib/glance -
激活 Image 服务:
#systemctl enable openstack-glance-{api,registry}#systemctl start openstack-glance-{api,registry} -
检查 Image 服务可以正常运行:
#glance image-list
-
-
安装 OpenStack Networking
-
安装
openstack-neutron软件包,以及所有需要使用的 OpenStack Networking 插件(如openstack-neutron-ml2和openstack-neutron-openvswitch):#yum install -y openstack-neutron{,-ml2,-openvswitch} -
把 OpenStack Networking 服务配置文件从 RHEL6 controller 复制到 RHEL7 controller 的
/etc/neutron中:#rsync -a BACKUP/etc/neutron/ /etc/neutron/备注
因为系统中的 OpenStack Networking UID 和 GID 可能会有所不同,修改这些文件的权限设置。#find /etc/neutron \! -group root -exec chgrp neutron {} \; -
升级 OpenStack Networking 数据库 schema:
#neutron-db-manage --config-file /etc/neutron/neutron.conf \--config-file /etc/neutron/plugin.ini \upgrade head -
激活 OpenStack Networking 服务:
#systemctl enable neutron-{dhcp-agent,l3-agent,metadata-agent,openvswitch-agent,server}#systemctl start neutron-{dhcp-agent,l3-agent,metadata-agent,openvswitch-agent,server}您可能还需要激活额外的 Neutron 代理来支持 LBaaS 和 VPNaaS 等服务。 -
检查 OpenStack Networking 代理已被启动,并可以正常运行:
#neutron agent-list这个命令的输出应该包括 coompute 主机上的 openvswitch 代理列表:+--------------------------------------+--------------------+------------------+-------+----------------+---------------------------+ | id | agent_type | host | alive | admin_state_up | binary | +--------------------------------------+--------------------+------------------+-------+----------------+---------------------------+ . . . | 15736a0a-acc2-4227-b0e3-3bb720351870 | Open vSwitch agent | compute-1.local | :-) | True | neutron-openvswitch-agent | | f87cc391-5263-4808-bf80-8b7d3caf8716 | Open vSwitch agent | compute-0.local | :-) | True | neutron-openvswitch-agent | +--------------------------------------+--------------------+------------------+-------+----------------+---------------------------+
这些列表应该在alive栏中显示:-)。
-
-
安装 Compute
-
安装
openstack-nova软件包:#yum install -y openstack-nova -
把 Compute 配置文件从您的 RHEL6 controller 复制到您的 RHEL7 controller 的
/etc/nova中:#rsync -a BACKUP/etc/nova/ /etc/nova/ -
修改
nova.conf文件中的 upgrade-levels 一段的内容来把 Compute API 限制在一个和 Icehouse 兼容的版本中:[upgrade-levels]
compute = 3.23.1conductor = 3.23.1备注
Juno controller 和 Icehouse compute 节点一起进行操作时需要这个设置。 -
升级 Compute 数据库 schema:
#sudo -u nova nova-manage db sync -
在您的 controller 上激活 Compute 服务:
#systemctl enable openstack-nova-{api,cert,conductor,consoleauth,novncproxy,scheduler}#systemctl start openstack-nova-{api,cert,conductor,consoleauth,novncproxy,scheduler} -
验证您的 Compute 服务已被正常启动:
#nova service-list您应该看到在 controller 中的服务,以及在 compute 节点上运行的nova-compute服务:+----+------------------+------------------+----------+---------+-------+----------------------------+-----------------+ | Id | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason | +----+------------------+------------------+----------+---------+-------+----------------------------+-----------------+ . . . | 5 | nova-compute | compute-0.local | nova | enabled | up | 2015-01-16T14:23:48.000000 | - | | 6 | nova-compute | compute-1.local | nova | enabled | up | 2015-01-16T14:23:43.000000 | - | +----+------------------+------------------+----------+---------+-------+----------------------------+-----------------+
nova-compute服务应该在State栏中显示。
-
-
安装 Dashboard
-
安装
openstack-dashboard软件包:#yum install -y openstack-dashboard -
把 Dashboard 配置文件从您的 RHEL6 controller 复制到您的 RHEL7 controller 的
/etc/openstack-dashboard中:#rsync -a BACKUP/etc/openstack-dashboard/ \/etc/openstack-dashboard/备注
启用httpd_can_network_connectSELinux 设置:setsebool httpd_can_network_connect=true -
激活 Apache 服务:
#systemctl enable httpd#systemctl start httpd
-
5. 升级 Compute 节点
步骤 2. 升级 Compute 节点
-
迁移 Compute 实例
-
在使用 RHEL7 重新安装一个 compute 节点前,把所有运行的实例迁移到其它 compute 节点上。如果您的环境支持实时迁移(live migration),您可以使用
nova live-migration命令(用户需要具有管理权限):#nova live-migration SERVER_UUID这个命令会把实例移到另外一台可用的 compute 节点上。如果您的环境不支持实时迁移,您可以使用nova migrate命令:#nova migrate SERVER_UUID这个命令会暂停虚拟服务器,并在另外一台可用的 compute 主机上恢复它。 -
服务器会处于
CONFIRM_RESIZE状态。对于每个服务器,运行resize-confirm命令:#nova resize-confirm SERVER_UUID备注
为了使nova migrate命令可以工作,在源主机上的nova用户需要可以使用ssh连接到远程主机的nova用户上。如需了解更多与迁移实例相关的信息,请参阅 https://access.redhat.com/articles/1265613。
-
-
部署 RHEL7 Compute 节点
-
安装需要的软件包:
#yum install -y openstack-selinux\openvswitch\ -
激活
openvswitch和libvirtd服务:#systemctl enable openvswitch#systemctl start openvswitch
-
-
安装 Virtualization 支持
-
安装
libvirt和qemu-kvm软件包:#yum install -y libvirt qemu-kvm -
从备份中恢复
libvirtd配置:#cp BACKUP/etc/libvirt/libvirtd.conf \/etc/libvirtd.conf -
激活
libvirtd服务:#systemctl enable libvirtd#systemctl start libvirtd
-
-
恢复 iptables 规则设置
-
把在 RHEL6 compute 节点中定义的所有本地防火墙配置导入到 RHEL7 compute 节点中。
-
安装
iptables-services软件包:#yum install -y iptables -services -
停止
iptables服务:#systemctl stop iptables -
从备份中恢复
iptables配置:#cp BACKUP/etc/sysconfig/iptables /etc/sysconfig/iptables -
激活
iptables服务:#systemctl enable iptables#systemctl start iptables
-
-
安装 OpenStack Networking
-
安装 OpenStack Networking OpenVswitch 代理:
#yum install -y openstack-neutron-openvswitch -
从备份中恢复 OpenStack Networking 配置:
#rsync -a BACKUP/etc/neutron/ /etc/neutron/ -
在主机上激活 OpenStack Networking 服务:
#systemctl enable neutron-openvswitch-agent neutron-ovs-cleanup#systemctl start neutron-openvswitch-agent -
在 controller 上使用
neutron agent-list命令验证 compute 节点上的代理可以正常工作。
-
-
安装 Compute
-
安装
openstack-nova-compute软件包:#yum install -y openstack-nova-compute -
从备份中恢复 Compute 配置:
#rsync -a BACKUP/etc/nova -
编辑
nova.conf文件把 compute API 限制在一个 Icehouse 兼容版本内:[upgrade levels]
compute = 3.23.1备注
Juno controller 和 Icehouse compute 节点一起进行操作时需要这个设置。 -
在 compute 主机上激活 Compute 服务:
#systemctl enable openstack-nova-compute#systemctl start openstack-nova-compute -
在 controller 上使用
nova service-list命令验证 compute 节点上的nova-compute服务可以正常工作:#nova service-list
-
