Пример #1
0
 def _copy_virtual_disk():
     """Copy a sparse virtual disk to a thin virtual disk."""
     # Copy a sparse virtual disk to a thin virtual disk. This is also
     # done to generate the meta-data file whose specifics
     # depend on the size of the disk, thin/thick provisioning and the
     # storage adapter type.
     vmdk_copy_spec = vm_util.get_vmdk_create_spec(
         client_factory, vmdk_file_size_in_kb, adapter_type, disk_type)
     vmdk_copy_task = self._session._call_method(
         self._session._get_vim(),
         "CopyVirtualDisk_Task",
         service_content.virtualDiskManager,
         sourceName=sparse_uploaded_vmdk_path,
         sourceDatacenter=self._get_datacenter_ref_and_name()[0],
         destName=uploaded_vmdk_path,
         destSpec=vmdk_copy_spec)
     self._session._wait_for_task(instance['name'], vmdk_copy_task)
Пример #2
0
 def _copy_virtual_disk():
     """Copy a sparse virtual disk to a thin virtual disk."""
     # Copy a sparse virtual disk to a thin virtual disk. This is also
     # done to generate the meta-data file whose specifics
     # depend on the size of the disk, thin/thick provisioning and the
     # storage adapter type.
     vmdk_copy_spec = vm_util.get_vmdk_create_spec(client_factory,
                             vmdk_file_size_in_kb, adapter_type,
                             disk_type)
     vmdk_copy_task = self._session._call_method(
         self._session._get_vim(),
         "CopyVirtualDisk_Task",
         service_content.virtualDiskManager,
         sourceName=sparse_uploaded_vmdk_path,
         sourceDatacenter=self._get_datacenter_ref_and_name()[0],
         destName=uploaded_vmdk_path,
         destSpec=vmdk_copy_spec)
     self._session._wait_for_task(instance['name'], vmdk_copy_task)
Пример #3
0
 def _create_virtual_disk():
     """Create a virtual disk of the size of flat vmdk file."""
     # Create a Virtual Disk of the size of the flat vmdk file. This is
     # done just to generate the meta-data file whose specifics
     # depend on the size of the disk, thin/thick provisioning and the
     # storage adapter type.
     # Here we assume thick provisioning and lsiLogic for the adapter
     # type
     vmdk_create_spec = vm_util.get_vmdk_create_spec(
         client_factory, vmdk_file_size_in_kb, adapter_type, disk_type)
     vmdk_create_task = self._session._call_method(
         self._session._get_vim(),
         "CreateVirtualDisk_Task",
         service_content.virtualDiskManager,
         name=uploaded_vmdk_path,
         datacenter=dc_ref,
         spec=vmdk_create_spec)
     self._session._wait_for_task(instance['name'], vmdk_create_task)
Пример #4
0
 def _create_virtual_disk():
     """Create a virtual disk of the size of flat vmdk file."""
     # Create a Virtual Disk of the size of the flat vmdk file. This is
     # done just to generate the meta-data file whose specifics
     # depend on the size of the disk, thin/thick provisioning and the
     # storage adapter type.
     # Here we assume thick provisioning and lsiLogic for the adapter
     # type
     vmdk_create_spec = vm_util.get_vmdk_create_spec(client_factory,
                             vmdk_file_size_in_kb, adapter_type,
                             disk_type)
     vmdk_create_task = self._session._call_method(
         self._session._get_vim(),
         "CreateVirtualDisk_Task",
         service_content.virtualDiskManager,
         name=uploaded_vmdk_path,
         datacenter=dc_ref,
         spec=vmdk_create_spec)
     self._session._wait_for_task(instance['name'], vmdk_create_task)