[openstack-dev] [masakari][nova] Allow evacuation of instances in resized state

Kekane, Abhishek Abhishek.Kekane at nttdata.com
Thu Jun 29 12:27:11 UTC 2017

Hi Chris,

IMO we cannot perform auto-confirm as confirming or reverting is user's choice, whereas reverting is not possible as the node where the instance is resized is down.
As suggested by you allowing this in nova require additional work. It is possible if we take power-state into consideration for evacuation operation, i.e. while evacuation if instance vmstate is resized and power-state is shutoff then we can stop that instance after evacuation.

Thank you,

Abhishek Kekane 

-----Original Message-----
From: Chris Friesen [mailto:chris.friesen at windriver.com] 
Sent: Wednesday, June 28, 2017 8:54 PM
To: openstack-dev at lists.openstack.org
Subject: Re: [openstack-dev] [masakari][nova] Allow evacuation of instances in resized state

On 06/28/2017 05:50 AM, Kekane, Abhishek wrote:

> In masakari, we are setting an instance to an error state if the 
> vmstate is resized before evacuating it to a new host.

Arguably the instance should be set to an error state as soon as you notice that the compute node is down.

> Once an instance (which was in
> resized state) is evacuated then it becomes active on the new host. 
> The main problem with this implementation from user’s point of view is 
> the instance goes into active state after evacuation, it should be in 
> stopped state if the prior action on the instance before resizing was 
> stop. In masakari, It’s possible to set the vm state to stopped state 
> after evacuation but for a short period the instance will go into the active state which is unacceptable.

That's a valid point, I think.

> *Proposing changes to Nova:*
> In the current nova code, if the instance is in stopped state before 
> evacuation, then it remains in the stopped state after evacuation is 
> complete. On the similar lines, we are proposing nova should allow 
> instance to be evacuated in resized state and after evacuation the 
> instance should remain in stopped state if the prior action on the instance is stopped before resizing.

The current nova code looks at the vm_state to decide whether or not it's allowable to evacuate, and while "stopped" is a valid state to evacuate from "resized" is not.  In your scenario it's both "stopped" *and* "resized" 
simultaneously, but there's no way to represent that in the vmstate so I think we'd have to check the power state, which would mean extending the
check_instance_state() routine since it doesn't currently handle the power state.

The trickier question is how to handle the "resized" state...after evacuating an instance in the "resized" state should you be able to revert the resize?  If so, how would that work in the case where the instance was resized on the same host originally and that host is no longer available?  If not, then you'll end up with resources permanently reserved on the host the instance was on before the resize.  I suppose one option would be to auto-confirm the resize in the case of a resize-to-same-host, but that'll be tricky to process with the host not available.

Also, it should be noted that when rebuilding/evacuating a "stopped" instance the nova code just boots it up as normal and sets the vm_state to "active", then realizes that it's supposed to be stopped and sets the task_state to "powering_off" and goes down the normal path to stop the instance, eventually setting the vm_state to "stopped".  So you're still going to end up with the same state transitions as what you have now, though the timing will probably be a bit tighter.  If you really want a stopped instance to not actually start up on a rebuild/evacuate then that would be additional work.


OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe

Disclaimer: This email and any attachments are sent in strictest confidence
for the sole use of the addressee and may contain legally privileged,
confidential, and proprietary data. If you are not the intended recipient,
please advise the sender by replying promptly to this email and then delete
and destroy this email and any attachments without any further use, copying
or forwarding.

More information about the OpenStack-dev mailing list