VM deployed with availability-zone (force_hosts) cannot be live migrated to an untargeted host
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
High
|
Sylvain Bauza | ||
Mitaka |
Fix Released
|
High
|
Sylvain Bauza |
Bug Description
Steps:
1) Deploy a VM to a specific host using availability zones (i.e., do a targeted deploy).
2) Attempt to live migrate the VM from (1) letting the scheduler decide what host to live migrate to (i.e., do an untargeted live migration).
Outcome:
The live migration will always fail.
Version: mitaka
This is happening because of the following recent change: https:/
nova/compute/
...
try:
...
self.
host_name, block_migration
After a lot of API plumbing, the flow ends up in nova/conductor/
...
attempted_hosts = [self.source]
...
host = None
while host is None:
...
try:
host = self.scheduler_
Example on a multi-node (2) devstack environment:
stack@controlle
stack@controlle
+------
| ID | Name | Status | OS-EXT-SRV-ATTR: Host |
+------
| a9fe19e4-
+------
mysql> select spec from request_specs where instance_
{
...
"nova_
"nova_
...,
...,
],
...,
},
...
}
stack@controlle
ERROR (BadRequest): No valid host was found. There are not enough hosts available. (HTTP 400) (Request-ID: req-78725630-
/opt/stack/
...
/opt/stack/
This is breaking previous behavior - the force_hosts field was not "sticky" in that it did not prevent the scheduler from moving the VM to another host after initial deploy. It previously only forced the initial deploy to go to a specific host.
Two possible fixes come to mind:
1) Do not save the force_hosts field in the DB. This may have unintended consequences that I have not thought through.
2) Remove the force_hosts field from the request_spec object that is used for the live migration task.
summary: |
VM deployed with availability-zone (force_hosts) cannot be live migrated + to an untargeted host |
tags: | added: availability-zones live-migration mitaka-rc-potential |
Changed in nova: | |
status: | New → Confirmed |
assignee: | nobody → Sylvain Bauza (sylvain-bauza) |
importance: | Undecided → High |
So, now evacuate, live-migrate and unshelve are using the existing RequestSpec.
Given that evacuate and live-migrate permit to give a destination in the API, it means that it's not a problem for those actions because when using a destination, it doesn't call the scheduler.
That said, unshelve doesn't ask for a destination so it means that the scheduler would then provide only the original forced host as a destination for unshelving, which could be a problem.
I'm working on a patch for fixing all of that.