s_logger.debug("1. The VM " + vmName + " is in Starting state.");
Host host = Host.getByUuid(conn, _host.uuid);
vm = createVmFromTemplate(conn, vmSpec, host);
GPUDeviceTO gpuDevice = vmSpec.getGpuDevice();
if (gpuDevice != null) {
s_logger.debug("Creating VGPU for of VGPU type: " + gpuDevice.getVgpuType() + " in GPU group "
+ gpuDevice.getGpuGroup() + " for VM " + vmName );
createVGPU(conn, cmd, vm, gpuDevice);
}
for (DiskTO disk : vmSpec.getDisks()) {
VDI newVdi = prepareManagedDisk(conn, disk, vmName);