vendredi 6 janvier 2017

Migration from Liberty to Mitaka at IPHC

This document details a simple procedure to upgrade OpenStack from Liberty to Mitaka. A short downtime of 2 hours is required to perform the upgrade and test the services.

To upgrade to Mitaka, the following steps are performed:
  1. Stop the daemons of the configuration management tool (Puppet, Chef, Quattor, ...) to ensure that it will not interfere with the upgrade procedure. We are using Quattor at IPHC. Two daemons need to be stopped:
    [root@controller ~]# service ncm-cdipsd stop
    [root@controller ~]# service cdp-listend stop
  2. Stop the OpenStack services and ensure with the systemctl command that they are effectily stopped:
    [root@controller ~]# for service in "nova neutron cinder glance"; do \
        service openstack-${service} stop \
    done
    [root@controller ~]# service httpd stop

    Note: we have created startup scripts, like /etc/init.d/openstack-nova, that manage all related daemons.
  3. We took advantage of this upgrade to perform some database cleanup:
    • Backup the database using mysql_dump
    • [root@controller ~]# keystone-manage token_flush
    • On our test infrastructure, we were not able to update the keystone database. This issue was caused by a UTF-8 charset problem. To fix this, we had to set correctly the charset (utf8/utf8_general_ci) of each table and database using the following script. This step is probably not  required if your installation of OpenStack if younger than Juno.
  4. Replace the RDO Liberty repo by the Mitaka repo and update the RPMs:
    [root@controller ~]# cat /etc/yum.repos.d/mitaka.repo
    [x86_64]
    name=OpenStack Mitaka Repository
    baseurl=http://mirror.centos.org/centos/7/cloud/x86_64/openstack-mitaka/
    enabled=1
    skip_if_unavailable=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Cloud
    priority=98
    [root@controller ~]# rm /etc/yum.repos.d/liberty.repo
  5. Install the configuration files for the new version. We are using our configuration management tools,  in manual mode):
    [root@controller ~]# ccm-fetch
    [root@controller ~]# ncm-ncd --config filecopy

    [root@controller ~]# ncm-ncd --config mysql
  6. Once all OpenStack components are configured, each database needs to be updated to the current schema:
    1. Keystone
      [root@controller ~]# su -s /bin/sh -c "keystone-manage db_sync" keystone
    2. Glance
      [root@controller ~]# su -s /bin/sh -c "glance-manage db_sync" glance
    3. Cinder
      [root@controller ~]# su -s /bin/sh -c "cinder-manage db sync" cinder
    4. Neutron
      [root@controller ~]# su -s /bin/sh -c "neutron-db-manage upgrade heads" neutron
    5. Nova
      First, if your configuration management tool do not create database, manually create the nova_api database and give the nova user access to it.
      [root@controller ~]# su -s /bin/sh -c "nova-manage api_db sync" nova
      [root@controller ~]# su -s /bin/sh -c "nova-manage db sync" nova
  7. The upgrade is completed, restart the OpenStack services, as well as the configuration management tool daemon(s). Look at the OpenStack log files for any errors and test your services with Tempest.

Aucun commentaire:

Enregistrer un commentaire