VMware: add instance detail to detach log message
Provide extra details when detaching a volume from an instance. Change-Id: I043bce041f82d18379ffc052ad8868ac425167fe
This commit is contained in:
parent
321b0a9711
commit
b1671b983c
@ -70,7 +70,8 @@ class VMwareVolumeOps(object):
|
||||
"disk %(vmdk_path)s or device %(device_name)s with type "
|
||||
"%(disk_type)s"),
|
||||
{'instance_name': instance_name, 'vmdk_path': vmdk_path,
|
||||
'device_name': device_name, 'disk_type': disk_type})
|
||||
'device_name': device_name, 'disk_type': disk_type},
|
||||
instance=instance)
|
||||
reconfig_task = self._session._call_method(
|
||||
self._session._get_vim(),
|
||||
"ReconfigVM_Task", vm_ref,
|
||||
@ -80,7 +81,8 @@ class VMwareVolumeOps(object):
|
||||
"disk %(vmdk_path)s or device %(device_name)s with type "
|
||||
"%(disk_type)s"),
|
||||
{'instance_name': instance_name, 'vmdk_path': vmdk_path,
|
||||
'device_name': device_name, 'disk_type': disk_type})
|
||||
'device_name': device_name, 'disk_type': disk_type},
|
||||
instance=instance)
|
||||
|
||||
def _update_volume_details(self, vm_ref, instance, volume_uuid):
|
||||
# Store the uuid of the volume_device
|
||||
@ -127,7 +129,8 @@ class VMwareVolumeOps(object):
|
||||
disk_key = device.key
|
||||
LOG.debug(_("Reconfiguring VM instance %(instance_name)s to detach "
|
||||
"disk %(disk_key)s"),
|
||||
{'instance_name': instance_name, 'disk_key': disk_key})
|
||||
{'instance_name': instance_name, 'disk_key': disk_key},
|
||||
instance=instance)
|
||||
reconfig_task = self._session._call_method(
|
||||
self._session._get_vim(),
|
||||
"ReconfigVM_Task", vm_ref,
|
||||
@ -135,7 +138,8 @@ class VMwareVolumeOps(object):
|
||||
self._session._wait_for_task(reconfig_task)
|
||||
LOG.debug(_("Reconfigured VM instance %(instance_name)s to detach "
|
||||
"disk %(disk_key)s"),
|
||||
{'instance_name': instance_name, 'disk_key': disk_key})
|
||||
{'instance_name': instance_name, 'disk_key': disk_key},
|
||||
instance=instance)
|
||||
|
||||
def discover_st(self, data):
|
||||
"""Discover iSCSI targets."""
|
||||
@ -220,7 +224,8 @@ class VMwareVolumeOps(object):
|
||||
|
||||
LOG.info(_("Mountpoint %(mountpoint)s attached to "
|
||||
"instance %(instance_name)s"),
|
||||
{'mountpoint': mountpoint, 'instance_name': instance_name})
|
||||
{'mountpoint': mountpoint, 'instance_name': instance_name},
|
||||
instance=instance)
|
||||
|
||||
def _attach_volume_iscsi(self, connection_info, instance, mountpoint):
|
||||
"""Attach iscsi volume storage to VM instance."""
|
||||
@ -231,7 +236,8 @@ class VMwareVolumeOps(object):
|
||||
"%(mountpoint)s"),
|
||||
{'connection_info': connection_info,
|
||||
'instance_name': instance_name,
|
||||
'mountpoint': mountpoint})
|
||||
'mountpoint': mountpoint},
|
||||
instance=instance)
|
||||
|
||||
data = connection_info['data']
|
||||
|
||||
@ -252,7 +258,8 @@ class VMwareVolumeOps(object):
|
||||
device_name=device_name)
|
||||
LOG.info(_("Mountpoint %(mountpoint)s attached to "
|
||||
"instance %(instance_name)s"),
|
||||
{'mountpoint': mountpoint, 'instance_name': instance_name})
|
||||
{'mountpoint': mountpoint, 'instance_name': instance_name},
|
||||
instance=instance)
|
||||
|
||||
def attach_volume(self, connection_info, instance, mountpoint):
|
||||
"""Attach volume storage to VM instance."""
|
||||
@ -382,7 +389,8 @@ class VMwareVolumeOps(object):
|
||||
vm_ref = vm_util.get_vm_ref(self._session, instance)
|
||||
# Detach Volume from VM
|
||||
LOG.debug(_("Detach_volume: %(instance_name)s, %(mountpoint)s"),
|
||||
{'mountpoint': mountpoint, 'instance_name': instance_name})
|
||||
{'mountpoint': mountpoint, 'instance_name': instance_name},
|
||||
instance=instance)
|
||||
data = connection_info['data']
|
||||
|
||||
device = self._get_vmdk_backed_disk_device(vm_ref, data)
|
||||
@ -394,7 +402,8 @@ class VMwareVolumeOps(object):
|
||||
self.detach_disk_from_vm(vm_ref, instance, device)
|
||||
LOG.info(_("Mountpoint %(mountpoint)s detached from "
|
||||
"instance %(instance_name)s"),
|
||||
{'mountpoint': mountpoint, 'instance_name': instance_name})
|
||||
{'mountpoint': mountpoint, 'instance_name': instance_name},
|
||||
instance=instance)
|
||||
|
||||
def _detach_volume_iscsi(self, connection_info, instance, mountpoint):
|
||||
"""Detach volume storage to VM instance."""
|
||||
@ -402,7 +411,8 @@ class VMwareVolumeOps(object):
|
||||
vm_ref = vm_util.get_vm_ref(self._session, instance)
|
||||
# Detach Volume from VM
|
||||
LOG.debug(_("Detach_volume: %(instance_name)s, %(mountpoint)s"),
|
||||
{'mountpoint': mountpoint, 'instance_name': instance_name})
|
||||
{'mountpoint': mountpoint, 'instance_name': instance_name},
|
||||
instance=instance)
|
||||
data = connection_info['data']
|
||||
|
||||
# Discover iSCSI Target
|
||||
@ -421,7 +431,8 @@ class VMwareVolumeOps(object):
|
||||
self.detach_disk_from_vm(vm_ref, instance, device, destroy_disk=True)
|
||||
LOG.info(_("Mountpoint %(mountpoint)s detached from "
|
||||
"instance %(instance_name)s"),
|
||||
{'mountpoint': mountpoint, 'instance_name': instance_name})
|
||||
{'mountpoint': mountpoint, 'instance_name': instance_name},
|
||||
instance=instance)
|
||||
|
||||
def detach_volume(self, connection_info, instance, mountpoint):
|
||||
"""Detach volume storage to VM instance."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user