Package: tripleo-upgrade
tripleo-upgradeThis role aims to provide a unified tool for upgrading TripleO based deploments.RequirementsThis role requires:An ansible inventory file containing reacheable undercloud and overcloud nodesNodes in the inventory file are placed in groups based on their roles (e.g compute nodes are part of the ‘compute’ group)Repositories containing packages to be upgraded are already installed on undercloud and overcloud nodes (or, for overcloud, define an upgrade_init_command variable)The initial overcloud deploy command is placed in a script file located in the path set by the overcloud_deploy_script var. Each option/environment file should be placed on a separate new line, e.g:source ~/stackrc
export THT=/usr/share/openstack-tripleo-heat-templates/

openstack overcloud deploy --templates $THT \
-r ~/openstack_deployment/roles/roles_data.yaml \
-e $THT/environments/network-isolation.yaml \
-e $THT/environments/network-management.yaml \
-e $THT/environments/storage-environment.yaml \
-e ~/openstack_deployment/environments/nodes.yaml \
-e ~/openstack_deployment/environments/network-environment.yaml \
-e ~/openstack_deployment/environments/disk-layout.yaml \
-e ~/openstack_deployment/environments/neutron-settings.yaml \
--log-file overcloud_deployment.log &> overcloud_install.logRole VariablesAvailable variables are listed below.Only create upgrade scripts without running them:upgrade_noop: falseOnly create update scripts without running them:update_noop: falseRun undercloud upgrade:undercloud_upgrade: falseRun containerized undercloud upgrade:containerized_undercloud_upgrade: falseRun overcloud upgrade:overcloud_upgrade: falseRun undercloud update:undercloud_update: falseRun overcloud update:overcloud_update: falseValidate overcloud after update:overcloud_images_validate: falseLocation of the initial overcloud deploy script:overcloud_deploy_script: "~/overcloud_deploy.sh"Location of the undercloud upgrade script which is going to be generated by this role:undercloud_upgrade_script: "~/undercloud_upgrade.sh"Location of the upgrade script used in the composable docker upgrade step which is going to be generated by this role:overcloud_composable_upgrade_script: "~/composable_docker_upgrade.sh"Location of the upgrade script used in the converge docker upgrade step which is going to be generated by this role:overcloud_converge_upgrade_script: "~/converge_docker_upgrade.sh"Location of the undercloud credentials file:undercloud_rc: "~/stackrc"Location of the overcloud credentials file:overcloud_rc: "~/overcloudrc"Allows the user to apply known issues workarounds during the upgrade process. The list of patches/commands used for workarounds should be passed via –extra-vars and it should include dictionaries for undercloud/overcloud workarounds:upgrade_workarounds: falseSet to true when the deployment has been done by tripleo quickstart:use_oooq: falseSet to true to launch an instance before starting upgrade. This can be useful for running tests during upgrade such as live migration or floating IP connectivity checks:workload_launch: falseSet to true to cleanup previously launched workload when update/upgrade finishes:workload_cleanup: falseName of the external network providing floating IPs for instance connectivity. This provides external connectivity and needs to exist beforehand, created by the user:external_network_name: "public"URL of the image used for the workload instance:workload_image_url: "https://download.cirros-cloud.net/0.6.0/cirros-0.6.0-x86_64-disk.img"Amount of memory assigned for the workload instance:workload_memory: "512"Set to true to use an SRIOV PF port when workload is created. Notice this will not work with cirros images:workload_sriov: falseSet to true when running the role in the TripleO CI jobs. It avoids losing connectivity to the undercloud by skipping reboot and ssh kill tasks:tripleo_ci: falseBash commands, defines a custom upgrade init to be taken into account during overcloud upgrade:upgrade_init_command: |
    sudo tripleo-repos -b pike currentSet it to true to get a multi-cell update.  It changes the way the oc_roles_hosts is calculated:update_cell: falseWhen set to true add a vm with attached fip and monitor ping from the undercloud. If ping loss time is higher thanloss_thresholdseconds orloss_threshold_percentin percentage we fail:l3_agent_connectivity_check: falseFor update run tasks we set a 0 seconds loss threshold by default:update_loss_threshold: 0Default time is 60 seconds for ping loss:loss_threshold: 60Failsafe percentage check for loss threashold in percentage:loss_threshold_percent: 1Set to true to enable validations:updates_validations: trueDependenciesNone.Example PlaybookAn example playbook is provided in tests/test.yml:- hosts: undercloud
  gather_facts: true
  become: true
  become_method: sudo
  become_user: stack
  roles:
    - tripleo-upgradeUsage with tripleo QuickstartAfter a successful deployment with OOOQ, you can create the necessary
scripts using this example playbook (duplicate from
./tests/oooq-test.yaml):---
- hosts: undercloud
  gather_facts: true
  become: true
  become_method: sudo
  become_user: stack
  roles:
  - { role: tripleo-upgrade, use_oooq: 'true'}And then you run it like this (adjust the paths to your oooq specific
one):ANSIBLE_SSH_ARGS="-F $(pwd)/ssh.config.ansible" \
  ANSIBLE_CONFIG=$PWD/ansible.cfg \
  ansible-playbook -i hosts -vvv tripleo-upgrade/tests/oooq-test.yamlThis will only create the file (without running the actual upgrade):undercloud_upgrade.shcomposable_docker_upgrade.shovercloud-compute-*_upgrade_pre.shovercloud-compute-*_upgrade.shovercloud-compute-*_upgrade_post.shconverge_docker_upgrade.shwith the correct parameters.Usage with InfraRedtripleo-upgrade comes preinstalled as an InfraRed plugin.
In order to install it manually, the following InfraRed command should be used:infrared plugin add tripleo-upgrade
# add with a specific revision / branch
infrared plugin add --revision stable/rocky tripleo-upgradeAfter a successful InfraRed overcloud deployment you need to run the following steps to upgrade the deployment:Symlink roles path:ln -s $(pwd)/plugins $(pwd)/plugins/tripleo-upgrade/infrared_plugin/rolesSet up undercloud upgrade repositories:infrared tripleo-undercloud \
    --upgrade yes \
    --mirror ${mirror_location} \
    --ansible-args="tags=upgrade_repos"Set up undercloud update repositories:infrared tripleo-undercloud \
    --update-undercloud yes \
    --mirror ${mirror_location} \
    --build latest \
    --version 12 \
    --ansible-args="tags=upgrade_repos"Upgrade undercloud:infrared tripleo-upgrade \
    --undercloud-upgrade yesUpdate undercloud:infrared tripleo-upgrade \
    --undercloud-update yesSet up overcloud upgrade repositories:infrared tripleo-overcloud \
    --deployment-files virt \
    --upgrade yes \
    --mirror ${mirror_location} \
    --ansible-args="tags=upgrade_collect_info,upgrade_repos"Set up overcloud update repositories/containers:infrared tripleo-overcloud \
    --deployment-files virt \
    --ocupdate True \
    --build latest \
    --ansible-args="tags=update_collect_info,update_undercloud_validation,update_repos,update_prepare_containers"Upgrade overcloud:infrared tripleo-upgrade \
    --overcloud-upgrade yesUpdate overcloud:infrared tripleo-upgrade \
    --overcloud-update yesAdvanced upgrade optionsOperator can now specify order of roles to upgrade by usingroles_upgrade_ordervariable.It’s theresponsibilityof operator to specifyControllerrole first followed by all other roles.roles_upgrade_ordervariable expects roles being separated by;(semicolon), for e.g.:infrared tripleo-upgrade \
    --overcloud-upgrade yes \
    -e 'roles_upgrade_order=ControllerOpenstack;Database;Messaging'will upgrade ControllerOpenstack group, then Database and finally Messaging.Multiple roles could be upgraded in parallel, to achieve this they should be separated by,(comma), for e.g:infrared tripleo-upgrade \
    --overcloud-upgrade yes \
    -e 'roles_upgrade_order=ControllerOpenstack,Database;Messaging'will upgrade Controller and Database groups in parallel and then continue with Messaging.Running the role manually from the undercloudThis role can be run manually from the undercloud by doing the following steps:Note: before starting the upgrade process make sure that both the undercloud
and overcloud nodes have the repositories with upgraded packages set upClone this repositorygit clonehttps://opendev.org/openstack/tripleo-upgradeSet ansible roles path::ANSIBLE_ROLES_PATH=$(pwd)Create inventory file::printf “[undercloud]nlocalhost  ansible_connection=local” > hostsRun the playbook including this role::ansible-playbook -i hosts tripleo-upgrade/tests/test.ymlLicenseApache License 2.0Author InformationAn optional section for the role authors to include contact information, or a website (HTML is not allowed).