Merge "Fixes Hyper-V resize down exception"
This commit is contained in:
commit
20991d38b2
@ -1513,7 +1513,7 @@ class HyperVAPITestCase(HyperVAPIBaseTestCase,
|
||||
(instance, fake_dest_ip, network_info, flavor) = args
|
||||
|
||||
self._mox.ReplayAll()
|
||||
self.assertRaises(vmutils.VHDResizeException,
|
||||
self.assertRaises(exception.InstanceFaultRollback,
|
||||
self._conn.migrate_disk_and_power_off,
|
||||
self._context, instance, fake_dest_ip,
|
||||
flavor, network_info)
|
||||
|
@ -18,6 +18,7 @@ Management class for migration / resize operations.
|
||||
"""
|
||||
import os
|
||||
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova.openstack.common import excutils
|
||||
from nova.openstack.common import log as logging
|
||||
@ -102,11 +103,13 @@ class MigrationOps(object):
|
||||
curr_root_gb = instance['root_gb']
|
||||
|
||||
if new_root_gb < curr_root_gb:
|
||||
raise vmutils.VHDResizeException(
|
||||
_("Cannot resize the root disk to a smaller size. Current "
|
||||
"size: %(curr_root_gb)s GB. Requested size: "
|
||||
"%(new_root_gb)s GB") %
|
||||
{'curr_root_gb': curr_root_gb, 'new_root_gb': new_root_gb})
|
||||
raise exception.InstanceFaultRollback(
|
||||
vmutils.VHDResizeException(
|
||||
_("Cannot resize the root disk to a smaller size. "
|
||||
"Current size: %(curr_root_gb)s GB. Requested size: "
|
||||
"%(new_root_gb)s GB") %
|
||||
{'curr_root_gb': curr_root_gb,
|
||||
'new_root_gb': new_root_gb}))
|
||||
|
||||
def migrate_disk_and_power_off(self, context, instance, dest,
|
||||
flavor, network_info,
|
||||
|
Loading…
Reference in New Issue
Block a user