From 30bc3c0933a1072e5e4c48b4614f5f387ffd8327 Mon Sep 17 00:00:00 2001 From: Vladyslav Drok Date: Fri, 11 Aug 2017 19:47:15 +0300 Subject: [PATCH] Set resource class during upgrade This is done to trigger a bit of code from commit c3118b91db4b97a689c9a2f25a9554a0ccb29252 to nova for active nodes. Change-Id: I1ac1b8501cbed901941e7c89fc55c5b9bea0cb4f --- devstack/upgrade/resources.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/devstack/upgrade/resources.sh b/devstack/upgrade/resources.sh index 9682b753b6..040ecab80e 100755 --- a/devstack/upgrade/resources.sh +++ b/devstack/upgrade/resources.sh @@ -93,7 +93,15 @@ function create { } function verify { - : + local side="$1" + + if [[ "$side" = "post-upgrade" ]]; then + nodes=$(openstack --os-baremetal-api-version 1.9 baremetal node list --provision-state active -f value -c UUID) + # Trigger nova flavor migration code for active instances. + for node_id in $nodes; do + openstack --os-baremetal-api-version 1.21 baremetal node set $node_id --resource-class baremetal + done + fi } function verify_noapi { @@ -131,10 +139,14 @@ case $1 in create ;; "verify_noapi") - verify_noapi + # NOTE(vdrok): our implementation of verify_noapi is a noop, but + # grenade always passes the upgrade side (pre-upgrade or post-upgrade) + # as an argument to it. Pass all the arguments grenade passes further. + verify_noapi "${@:2}" ;; "verify") - verify + # NOTE(vdrok): pass all the arguments grenade passes further. + verify "${@:2}" ;; "destroy") destroy