示例#1
0
 def _get_vm_and_vmdk_attribs():
     # Get the vmdk file name that the VM is pointing to
     hardware_devices = self._session._call_method(
         vim_util, "get_dynamic_property", vm_ref, "VirtualMachine", "config.hardware.device"
     )
     _vmdk_info = vm_util.get_vmdk_file_path_and_adapter_type(client_factory, hardware_devices)
     vmdk_file_path_before_snapshot, adapter_type = _vmdk_info
     datastore_name = vm_util.split_datastore_path(vmdk_file_path_before_snapshot)[0]
     os_type = self._session._call_method(
         vim_util, "get_dynamic_property", vm_ref, "VirtualMachine", "summary.config.guestId"
     )
     return (vmdk_file_path_before_snapshot, adapter_type, datastore_name, os_type)
示例#2
0
文件: vmops.py 项目: kiall/nova
 def _get_vm_and_vmdk_attribs():
     # Get the vmdk file name that the VM is pointing to
     hardware_devices = self._session._call_method(vim_util,
                 "get_dynamic_property", vm_ref,
                 "VirtualMachine", "config.hardware.device")
     _vmdk_info = vm_util.get_vmdk_file_path_and_adapter_type(
                  client_factory, hardware_devices)
     vmdk_file_path_before_snapshot, adapter_type = _vmdk_info
     datastore_name = vm_util.split_datastore_path(
                               vmdk_file_path_before_snapshot)[0]
     os_type = self._session._call_method(vim_util,
                 "get_dynamic_property", vm_ref,
                 "VirtualMachine", "summary.config.guestId")
     return (vmdk_file_path_before_snapshot, adapter_type,
             datastore_name, os_type)