diff options
| author | Liam Kelleher <liam.kelleher@hp.com> | 2013-02-11 15:51:53 +0000 |
|---|---|---|
| committer | Liam Kelleher <liam.kelleher@hp.com> | 2013-02-14 17:29:18 +0000 |
| commit | 1504cbc5d4a27695fa663f0b0f3f7b48745bdb45 (patch) | |
| tree | f7c111b87437e99fe79ead9429bf265dda83eee9 /nova/compute | |
| parent | 4ffddcfa6385703ce9a02f624999f05b388778e6 (diff) | |
Add option to allow cross AZ attach configurable
Make check_attach() optionally check if the volume and instance
are in the same availability zone and if cross AZ attach
is configured as not allowed report error.
This does not change the current default behaviour.
DocImpact: Adds a new Nova Config option
Change-Id: Ib0e085888b1c6620869261d87cd964de302accb3
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/api.py | 2 | ||||
| -rw-r--r-- | nova/compute/cells_api.py | 2 | ||||
| -rwxr-xr-x | nova/compute/manager.py | 3 |
3 files changed, 4 insertions, 3 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index 658673e50..3337fc82e 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -2244,7 +2244,7 @@ class API(base.Base): context, device=device, instance=instance, volume_id=volume_id) try: volume = self.volume_api.get(context, volume_id) - self.volume_api.check_attach(context, volume) + self.volume_api.check_attach(context, volume, instance=instance) self.volume_api.reserve_volume(context, volume) self.compute_rpcapi.attach_volume(context, instance=instance, volume_id=volume_id, mountpoint=device) diff --git a/nova/compute/cells_api.py b/nova/compute/cells_api.py index 50449df04..1e30331bc 100644 --- a/nova/compute/cells_api.py +++ b/nova/compute/cells_api.py @@ -524,7 +524,7 @@ class ComputeCellsAPI(compute_api.API): context, device=device, instance=instance, volume_id=volume_id) try: volume = self.volume_api.get(context, volume_id) - self.volume_api.check_attach(context, volume) + self.volume_api.check_attach(context, volume, instance=instance) except Exception: with excutils.save_and_reraise_exception(): self.db.block_device_mapping_destroy_by_instance_and_device( diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 8927e682a..18b0f3ae1 100755 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -645,7 +645,8 @@ class ComputeManager(manager.SchedulerDependentManager): if bdm['volume_id'] is not None: volume = self.volume_api.get(context, bdm['volume_id']) - self.volume_api.check_attach(context, volume) + self.volume_api.check_attach(context, volume, + instance=instance) cinfo = self._attach_volume_boot(context, instance, volume, |
