nova host-evacuate command failed

Asked by gareen on 2014-11-12

hi, i run nova host-evacuate failed
steps:
1. running two compute hosts A and B
2. run instance vm01 on host A, shutdown host A
3. run command nova host-evacuate --target_host B --on-shared-storage A

controller nova log:
nova.api.openstack.wsgi INFO: HTTP exception thrown: Cannot 'evacuate' while instance is in vm_state error

but run command nova show vm01, its OS-EXT-STS:vm_state=stopped
mysql db select * from instances where uuid="vm01_uuid"; its vm_state=stopped

why does the instance vm_state from compute api become error during host-evacuate?

nova.api.openstack.compute.contrib.evacuate.Controller._evacuate code:
.......
        try:
            instance = self.compute_api.get(context, id)
            self.compute_api.evacuate(context, instance, host,
                                      on_shared_storage, password)
        except exception.InstanceInvalidState as state_error:
            common.raise_http_conflict_for_instance_invalid_state(state_error,
                    'evacuate')
.......

my nova package version is openstack-nova-api-2014.1.1-2.el6.noarch
thanks very much.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu nova Edit question
Assignee:
No assignee Edit question
Solved by:
gareen
Solved:
2014-11-13
Last query:
2014-11-13
Last reply:
gareen (thesea1982-e) said : #1

o, i got the key for my problem, because there is dirty instances data in db.
cli "nova list" returns empty value,
but cli "nova hypervisor-servers A" returns two instances data.

cli "nova host-evacuate ..." includes two steps:
1.nova hypervisor-servers A ---- get all servers on host A
2.nova evacuate --on-shared-storage <server> B ---- evacuate every server on host A

so my problem shows up always.
it is my personal experience, thanks.