'power-state' should not be 'running' when instance evacuate failed

Bug #1439919 reported by Eric Xie
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Confirmed
Low
Unassigned

Bug Description

My environment:
1. nova 2014.1
2. novaclient 2.17.0

I checked the source:
nova.compute.manager.py:
 def rebuild_instance(self, context, instance, orig_image_ref, image_ref,
                         injected_files, new_pass, orig_sys_metadata,
                         bdms, recreate, on_shared_storage,
                         preserve_ephemeral=False):
        with self._error_out_instance_on_exception(context, instance):
            LOG.info(_LI("Rebuilding instance"), context=context,
                      instance=instance)

            if recreate:
                if not self.driver.capabilities["supports_recreate"]:
                    raise exception.InstanceRecreateNotSupported

If raise InstanceRecreateNotSupported, only set vm_state to 'ERROR', but task_state was 'running' which should be set to 'NOSTAT' or else.

    def _error_out_instance_on_exception(self, context, instance,
                                         quotas=None,
                                         instance_state=vm_states.ACTIVE):
...
        except Exception:
            LOG.exception(_LE('Setting instance vm_state to ERROR'),
                          instance_uuid=instance_uuid)
            with excutils.save_and_reraise_exception():
                if quotas:
                    quotas.rollback()
                self._set_instance_error_state(context, instance)

Tags: compute
Revision history for this message
Eli Qiao (taget-9) wrote :

hi Eric,
Can I assign it myself?

Eli.

Eli Qiao (taget-9)
Changed in nova:
status: New → Confirmed
assignee: nobody → Eli Qiao (taget-9)
Revision history for this message
Eric Xie (mark-xiett) wrote :

Hi Eli,
Of course you can:)

Revision history for this message
Eli Qiao (taget-9) wrote :

hi Eric, do you mean Power State is running ?

Revision history for this message
Eli Qiao (taget-9) wrote :

actually , the vm itself get nothing error.
I think it's better to set back it's vm_state back vm_states.ACTIVE instead of ERROR.

Eli Qiao (taget-9)
Changed in nova:
status: Confirmed → Incomplete
Revision history for this message
Eric Xie (mark-xiett) wrote :

Hi Eli,
Agree with that "it's better to set back it's vm_state back vm_states.ACTIVE instead of ERROR."

Should it be ACTIVE instead of ERROR before source below?
                finally:
                    instance.host = self.host
                    instance.node = node_name
                    instance.save()

Revision history for this message
Eli Qiao (taget-9) wrote :

After some discussion with other colleague, we need to set power-state to None and vm_state to ERROR, since we are doing an evacuate , and host node is down, so we need to make sure the power_state on that 'down' status host is None(consistent with host state)

Changed in nova:
status: Incomplete → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/173150

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
Eli Qiao (taget-9) wrote :

seen from https://wiki.openstack.org/wiki/VMState

I think this can be acceptable if powerstate is Running, and we can not
manually change power_state , which should be bottom-up updated by hypervisor.

Eli.

Changed in nova:
status: In Progress → Incomplete
Changed in nova:
status: Incomplete → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Eli Qiao (<email address hidden>) on branch: master
Review: https://review.openstack.org/173150

Revision history for this message
John Garbutt (johngarbutt) wrote :

no longer being worked on, so reset the assignee.

tags: added: api compute
tags: removed: api
Changed in nova:
importance: Undecided → Low
status: In Progress → Confirmed
assignee: Eli Qiao (taget-9) → nobody
Revision history for this message
Eli Qiao (taget-9) wrote :

hi John, can you give some advice on how to go with this bug?

are you confirmed this is a bug or not?

if it is a bug, I'd like to continue working on it.

if it's possible, could you help and leave comments on my abandoned patch on #9?

thanks Eli.

Eli Qiao (taget-9)
Changed in nova:
assignee: nobody → Eli Qiao (taget-9)
Revision history for this message
Sujitha (sujitha-neti) wrote :

There are no open reviews for this bug report since a long time.
To signal that to other contributors which might provide patches for
this bug, I'm removing the assignee.

Feel free to add yourself as assignee and push a patch for it.

Changed in nova:
assignee: Eli Qiao (taget-9) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.