VM re-scheduler mechanism will cause BDM-volumes conflict
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
High
|
wingwj | ||
Havana |
Fix Released
|
High
|
Nikola Đipanov |
Bug Description
Due to re-scheduler mechanism, when a user tries to
create (in error) an instance using a volume
which is already in use by another instance,
the error is correctly detected, but the recovery code
will incorrectly affect the original instance.
Need to raise exception directly when the situation above occurred.
-------
-------
We can create VM1 with BDM-volumes (for example, one volume we called it “Vol-1”).
But when the attached-volume (Vol-1..) involved in BDM parameters to create a new VM2, due to VM re-scheduler mechanism, the volume will change to attach on the new VM2 in Nova & Cinder, instead of raise an “InvalidVolume” exception of “Vol-1 is already attached on VM1”.
In actually, Vol-1 both attached on VM1 and VM2 on hypervisor. But when you operate Vol-1 on VM1, you can’t see any corresponding changes on VM2…
I reproduced it and wrote in the doc. Please check the attachment for details~
-------
I checked on the Nova codes, the problem is caused by VM re-scheduler mechanism:
Now Nova will check the state of BDM-volumes from Cinder now [def _setup_
According to existing processes in Nova, before VM re-scheduler, it will shutdown VM and detach all BDM-volumes in Cinder for rollback [def _shutdown_
Therefore, after re-scheduler, it will pass the BDM-volumes checking in creating VM2 on the second time, and all VM1’s BDM-volumes (Vol-1) will be possessed by VM2 and are recorded in Nova & Cinder DB. But Vol-1 is still attached on VM1 on hypervisor, and will also attach on VM2 after VM creation success…
---------------
Moreover, the problem mentioned-above will occur when “delete_
(P.S. Success depends on the specific implementation of Cinder Driver)
Thanks~
Changed in nova: | |
assignee: | nobody → wingwj (wingwj) |
Changed in nova: | |
status: | New → Incomplete |
Changed in nova: | |
status: | Incomplete → Confirmed |
Changed in nova: | |
importance: | Undecided → High |
tags: | added: folsom-backport-potential grizzly-backport-potential |
Changed in nova: | |
status: | Confirmed → In Progress |
description: | updated |
tags: | removed: folsom-backport-potential grizzly-backport-potential |
Changed in nova: | |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | icehouse-rc1 → 2014.1 |
We can add a new “InvalidVolume” exception branch processing in _run_instance(). If it occurred, raise the exception directly to instead of re-scheduler.
That’s the easiest way in my opinion.
The new patch I made is based on the master branch version on Jun,29th. Plz check the test-doc~~
Thanks~