mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-09 11:46:49 +00:00
fix(instances): a VM shut down after its Migrate tab opened moves offline
The Migrate tab shows a running VM's live migration switch, on by default. A VM shut down after the tab opened, as one is to move it shut off, was then refused: "A shut-off VM cannot be migrated live". A shut-off VM now moves offline whatever the request says about live, as the tab tells for a shut-off VM; the tuning options are for a running VM only, as before. An offline request for a running or paused VM is still refused.
This commit is contained in:
parent
dbc7e688ac
commit
f63c1ebe32
2 changed files with 6 additions and 5 deletions
|
|
@ -287,7 +287,7 @@ class MigrationModeTestCase(unittest.TestCase):
|
|||
return mode, source.instance.calls[0][0] if source.instance.calls else None
|
||||
|
||||
def test_refused_requests(self):
|
||||
for state, request in ((5, {"live": True}), (1, {"offline": True}), (3, {"offline": True}),
|
||||
for state, request in ((1, {"offline": True}), (3, {"offline": True}),
|
||||
(1, {"live": True, "offline": True}), (6, {}), (4, {}), (7, {}), (0, {})):
|
||||
with self.subTest(state=state, request=request):
|
||||
source = FakeSource(state)
|
||||
|
|
@ -325,6 +325,8 @@ class MigrationModeTestCase(unittest.TestCase):
|
|||
self.assertEqual(flags & (live | unsafe | converge | compressed), live)
|
||||
self.assertEqual(self.migrate(5), ("offline", None))
|
||||
self.assertEqual(self.migrate(5, offline=True), ("offline", None))
|
||||
# asked while it ran, then shut down: it moves offline, the tuning options unused
|
||||
self.assertEqual(self.migrate(5, live=True, autoconverge=True, compress=True), ("offline", None))
|
||||
|
||||
|
||||
def with_disks(*disks):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue