Ask Your Question
0

Confirm Instance Resize through API

asked 2017-09-07 00:19:23 -0500

CDOT gravatar image

Hi I am trying to resize my instance through python-novaclient API using :

server_resources.resize(server,new_flavor_id)
server_resources.confirm_resize(server)

The problem here is that the second method-call is not waiting for the first to finish. So I am getting the exception :

novaclient.exceptions.Conflict: Cannot 'confirmResize' instance 35961255-a2ec-4324-afb1-4084adf10ca3 while it is in vm_state active (HTTP 409) (Request-ID: req-06cb90cf-58d9-476c-be43-ba67eec1c71b)

How to proceed?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-09-07 03:41:17 -0500

ppeereb1 gravatar image

Ran into the same issue; got a workaround by just waiting untill the instance.status is on "VERIFY_RESIZE"

            instance = nova.servers.get(server.id)
            nova.servers.resize(server,new_flavor_id)
            while instance.status != "VERIFY_RESIZE":
                instance = nova.servers.get(server.id)
                time.sleep(3)
            nova.servers.confirm_resize(server.id)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2017-09-07 00:19:23 -0500

Seen: 581 times

Last updated: Sep 07 '17