Chapter 4. Upgrading Red Hat Ceph Storage within containers
The Ansible application preforms the upgrade of Red Hat Ceph Storage running within containers.
4.1. Prerequisites
- A running Red Hat Ceph Storage cluster.
4.2. Upgrading a Red Hat Ceph Storage Cluster That Runs in Containers
This section describes how to upgrade to a newer minor or major version of the Red Hat Ceph Storage container image.
- To upgrade a storage cluster, see Section 4.3, “Upgrading the Storage Cluster”.
- To upgrade Red Hat Ceph Storage Dashboard, see Section 4.4, “Upgrading Red Hat Ceph Storage Dashboard”.
Use the Ansible rolling_update.yml
playbook located in the /usr/share/ceph-ansible/infrastructure-playbooks/
directory from the administration node to upgrade between two major or minor versions of Red Hat Ceph Storage, or to apply asynchronous updates.
Ansible upgrades the Ceph nodes in the following order:
- Monitor nodes
- MGR nodes
- OSD nodes
- MDS nodes
- Ceph Object Gateway nodes
- All other Ceph client nodes
Red Hat Ceph Storage 3 introduces several changes in Ansible configuration files located in the /usr/share/ceph-ansible/group_vars/
directory; certain parameters were renamed or removed. Therefore, make backup copies of the all.yml
and osds.yml
files before creating new copies from the all.yml.sample
and osds.yml.sample
files after upgrading to version 3. For more details about the changes, see Appendix A, Changes in Ansible Variables Between Version 2 and 3.
Red Hat Ceph Storage 3.1 and later introduces new Ansible playbooks to optimize storage for performance when using Object Gateway and high speed NVMe based SSDs (and SATA SSDs). The playbooks do this by placing journals and bucket indexes together on SSDs, which can increase performance compared to having all journals on one device. These playbooks are designed to be used when installing Ceph. Existing OSDs continue to work and need no extra steps during an upgrade. There is no way to upgrade a Ceph cluster while simultaneously reconfiguring OSDs to optimize storage in this way. To use different devices for journals or bucket indexes requires reprovisioning OSDs. For more information see Using NVMe with LVM optimally in Ceph Object Gateway for Production.
The rolling_update.yml
playbook includes the serial
variable that adjusts the number of nodes to be updated simultaneously. Red Hat strongly recommends to use the default value (1
), which ensures that Ansible will upgrade cluster nodes one by one.
When using the rolling_update.yml
playbook to upgrade to any Red Hat Ceph Storage 3.x version, users who use the Ceph File System (CephFS) must manually update the Metadata Server (MDS) cluster. This is due to a known issue.
Comment out the MDS hosts in /etc/ansible/hosts
before upgrading the entire cluster using ceph-ansible
rolling_update.yml
, and then upgrade MDS manually. In the /etc/ansible/hosts
file:
#[mdss] #host-abc
For more details about this known issue, including how to update the MDS cluster, refer to the Red Hat Ceph Storage 3.0 Release Notes.
When upgrading a Red Hat Ceph Storage cluster from a previous version to 3.2, the Ceph Ansible configuration will default the object store type to BlueStore. If you still want to use FileStore as the OSD object store, then explicitly set the Ceph Ansible configuration to FileStore. This ensures newly deployed and replaced OSDs are using FileStore.
When using the rolling_update.yml
playbook to upgrade to any Red Hat Ceph Storage 3.x version, and if you are using a multisite Ceph Object Gateway configuration, then you do not have to manually update the all.yml
file to specify the multisite configuration.
Prerequisites
-
Log in as the
root
user on all nodes in the storage cluster. On all nodes in the storage cluster, enable the
rhel-7-server-extras-rpms
repository.# subscription-manager repos --enable=rhel-7-server-extras-rpms
If upgrading from Red Hat Ceph Storage 2.x to 3.x, on the Ansible administration node and the RBD mirroring node, enable the Red Hat Ceph Storage 3 Tools repository:
# subscription-manager repos --enable=rhel-7-server-rhceph-3-tools-els-rpms
On the Ansible adminstration node, enable the Ansible repository:
[root@admin ~]# subscription-manager repos --enable=rhel-7-server-ansible-2.6-rpms
On the Ansible administration node, ensure the latest version of the
ansible
andceph-ansible
packages are installed.[root@admin ~]# yum update ansible ceph-ansible
4.3. Upgrading the Storage Cluster
Procedure
Use the following commands from the Ansible administration node.
As the
root
user, navigate to the/usr/share/ceph-ansible/
directory:[root@admin ~]# cd /usr/share/ceph-ansible/
Skip this step when upgrading from Red Hat Ceph Storage version 3.x to the latest version. Back up the
group_vars/all.yml
andgroup_vars/osds.yml
files.[root@admin ceph-ansible]# cp group_vars/all.yml group_vars/all_old.yml [root@admin ceph-ansible]# cp group_vars/osds.yml group_vars/osds_old.yml [root@admin ceph-ansible]# cp group_vars/clients.yml group_vars/clients_old.yml
Skip this step when upgrading from Red Hat Ceph Storage version 3.x to the latest version. When upgrading from Red Hat Ceph Storage 2.x to 3.x, create new copies of the
group_vars/all.yml.sample
,group_vars/osds.yml.sample
andgroup_vars/clients.yml.sample
files, and rename them togroup_vars/all.yml
,group_vars/osds.yml
, andgroup_vars/clients.yml
respectively. Open and edit them accordingly. For details, see Appendix A, Changes in Ansible Variables Between Version 2 and 3 and Section 1.2, “Installing a Red Hat Ceph Storage Cluster in Containers” .[root@admin ceph-ansible]# cp group_vars/all.yml.sample group_vars/all.yml [root@admin ceph-ansible]# cp group_vars/osds.yml.sample group_vars/osds.yml [root@admin ceph-ansible]# cp group_vars/clients.yml.sample group_vars/clients.yml
Skip this step when upgrading from Red Hat Ceph Storage version 3.x to the latest version. When upgrading from Red Hat Ceph Storage 2.x to 3.x, open the
group_vars/clients.yml
file, and uncomment the following lines:keys: - { name: client.test, caps: { mon: "allow r", osd: "allow class-read object_prefix rbd_children, allow rwx pool=test" }, mode: "{{ ceph_keyring_permissions }}" }
Replace
client.test
with the real client name, and add the client key to the client definition line, for example:key: "ADD-KEYRING-HERE=="
Now the whole line example would look similar to this:
- { name: client.test, key: "AQAin8tUMICVFBAALRHNrV0Z4MXupRw4v9JQ6Q==", caps: { mon: "allow r", osd: "allow class-read object_prefix rbd_children, allow rwx pool=test" }, mode: "{{ ceph_keyring_permissions }}" }
NoteTo get the client key, run the
ceph auth get-or-create
command to view the key for the named client.
When upgrading from 2.x to 3.x, in the
group_vars/all.yml
file change theceph_docker_image
parameter to point to the Ceph 3 container version.ceph_docker_image: rhceph/rhceph-3-rhel7
Add the
fetch_directory
parameter to thegroup_vars/all.yml
file.fetch_directory: <full_directory_path>
Replace:
-
<full_directory_path>
with a writable location, such as the Ansible user’s home directory. Provide the existing path that was used for the initial storage cluster installation.
If the existing path is lost or missing, then do the following first:
Add the following options to the existing
group_vars/all.yml
file:fsid: <add_the_fsid> generate_fsid: false
Run the
take-over-existing-cluster.yml
Ansible playbook:[user@admin ceph-ansible]$ cp infrastructure-playbooks/take-over-existing-cluster.yml . [user@admin ceph-ansible]$ ansible-playbook take-over-existing-cluster.yml
-
If the cluster you want to upgrade contains any Ceph Object Gateway nodes, add the
radosgw_interface
parameter to thegroup_vars/all.yml
file.radosgw_interface: <interface>
Replace:
-
<interface>
with the interface that the Ceph Object Gateway nodes listen to.
-
Starting with Red Hat Ceph Storage 3.2, the default OSD object store is BlueStore. To keep the traditional OSD object store, you must explicitly set the
osd_objectstore
option tofilestore
in thegroup_vars/all.yml
file.osd_objectstore: filestore
NoteWith the
osd_objectstore
option set tofilestore
, replacing an OSD will use FileStore, instead of BlueStore.In the Ansible inventory file located at
/etc/ansible/hosts
, add the Ceph Manager (ceph-mgr
) nodes under the[mgrs]
section. Colocate the Ceph Manager daemon with Monitor nodes. Skip this step when upgrading from version 3.x to the latest version.[mgrs] <monitor-host-name> <monitor-host-name> <monitor-host-name>
Copy
rolling_update.yml
from theinfrastructure-playbooks
directory to the current directory.[root@admin ceph-ansible]# cp infrastructure-playbooks/rolling_update.yml .
Create the
/var/log/ansible/
directory and assign the appropriate permissions for theansible
user:[root@admin ceph-ansible]# mkdir /var/log/ansible [root@admin ceph-ansible]# chown ansible:ansible /var/log/ansible [root@admin ceph-ansible]# chmod 755 /var/log/ansible
Edit the
/usr/share/ceph-ansible/ansible.cfg
file, updating thelog_path
value as follows:log_path = /var/log/ansible/ansible.log
As the Ansible user, run the playbook:
[user@admin ceph-ansible]$ ansible-playbook rolling_update.yml
To use the playbook only for a particular group of nodes on the Ansible inventory file, use the
--limit
option. For details, see Section 1.8, “Understanding thelimit
option”.While logged in as the
root
user on the RBD mirroring daemon node, upgraderbd-mirror
manually:# yum upgrade rbd-mirror
Restart the daemon:
# systemctl restart ceph-rbd-mirror@<client-id>
Verify that the cluster health is OK.
Log into a monitor node as the
root
user and list all running containers.[root@monitor ~]# docker ps
Verify the cluster health is OK.
[root@monitor ~]# docker exec ceph-mon-<mon-id> ceph -s
Replace:
-
<mon-id>
with the name of the Monitor container found in the first step.
For example:
[root@monitor ~]# docker exec ceph-mon-monitor ceph -s
-
If working in an OpenStack environment, update all the
cephx
users to use the RBD profile for pools. The following commands must be run as theroot
user:Glance users
ceph auth caps client.glance mon 'profile rbd' osd 'profile rbd pool=<glance-pool-name>'
Example
[root@monitor ~]# ceph auth caps client.glance mon 'profile rbd' osd 'profile rbd pool=images'
Cinder users
ceph auth caps client.cinder mon 'profile rbd' osd 'profile rbd pool=<cinder-volume-pool-name>, profile rbd pool=<nova-pool-name>, profile rbd-read-only pool=<glance-pool-name>'
Example
[root@monitor ~]# ceph auth caps client.cinder mon 'profile rbd' osd 'profile rbd pool=volumes, profile rbd pool=vms, profile rbd-read-only pool=images'
OpenStack general users
ceph auth caps client.openstack mon 'profile rbd' osd 'profile rbd-read-only pool=<cinder-volume-pool-name>, profile rbd pool=<nova-pool-name>, profile rbd-read-only pool=<glance-pool-name>'
Example
[root@monitor ~]# ceph auth caps client.openstack mon 'profile rbd' osd 'profile rbd-read-only pool=volumes, profile rbd pool=vms, profile rbd-read-only pool=images'
ImportantDo these CAPS updates before performing any live client migrations. This allows clients to use the new libraries running in memory, causing the old CAPS settings to drop from cache and applying the new RBD profile settings.
4.4. Upgrading Red Hat Ceph Storage Dashboard
The following procedure outlines the steps to upgrade Red Hat Ceph Storage Dashboard from version 3.1 to 3.2.
Before upgrading, ensure Red Hat Ceph Storage is upgraded from version 3.1 to 3.2. See 4.1. Upgrading the Storage Cluster for instructions.
The upgrade procedure will remove historical Storage Dashboard data.
Procedure
As the
root
user, update thecephmetrics-ansible
package from the Ansible administration node:[root@admin ~]# yum update cephmetrics-ansible
Change to the
/usr/share/cephmetrics-ansible
directory:[root@admin ~]# cd /usr/share/cephmetrics-ansible
Install the updated Red Hat Ceph Storage Dashboard:
[root@admin cephmetrics-ansible]# ansible-playbook -v playbook.yml