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 LOG.debug(_("Creating Virtual Disk of size " "%(vmdk_file_size_in_kb)s KB and adapter type " "%(adapter_type)s on the ESX host local store" " %(data_store_name)s") % {"vmdk_file_size_in_kb": vmdk_file_size_in_kb, "adapter_type": adapter_type, "data_store_name": data_store_name}) vmdk_create_spec = vm_util.get_vmdk_create_spec(client_factory, vmdk_file_size_in_kb, adapter_type) vmdk_create_task = self._session._call_method( self._session._get_vim(), "CreateVirtualDisk_Task", service_content.virtualDiskManager, name=uploaded_vmdk_path, datacenter=self._get_datacenter_name_and_ref()[0], spec=vmdk_create_spec) self._session._wait_for_task(instance.id, vmdk_create_task) LOG.debug(_("Created Virtual Disk of size %(vmdk_file_size_in_kb)s" " KB on the ESX host local store " "%(data_store_name)s") % {"vmdk_file_size_in_kb": vmdk_file_size_in_kb, "data_store_name": data_store_name})
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 LOG.debug( _("Creating Virtual Disk of size " "%(vmdk_file_size_in_kb)s KB and adapter type " "%(adapter_type)s on the ESX host local store" " %(data_store_name)s") % { "vmdk_file_size_in_kb": vmdk_file_size_in_kb, "adapter_type": adapter_type, "data_store_name": data_store_name }) vmdk_create_spec = vm_util.get_vmdk_create_spec( client_factory, vmdk_file_size_in_kb, adapter_type) vmdk_create_task = self._session._call_method( self._session._get_vim(), "CreateVirtualDisk_Task", service_content.virtualDiskManager, name=uploaded_vmdk_path, datacenter=self._get_datacenter_name_and_ref()[0], spec=vmdk_create_spec) self._session._wait_for_task(instance.id, vmdk_create_task) LOG.debug( _("Created Virtual Disk of size %(vmdk_file_size_in_kb)s" " KB on the ESX host local store " "%(data_store_name)s") % { "vmdk_file_size_in_kb": vmdk_file_size_in_kb, "data_store_name": data_store_name })