@@ -1113,7 +1113,8 @@ private UserVm importVirtualMachineInternal(final UnmanagedInstanceTO unmanagedI
11131113 final VirtualMachineTemplate template , final String displayName , final String hostName , final Account caller , final Account owner , final Long userId ,
11141114 final ServiceOfferingVO serviceOffering , final Map <String , Long > dataDiskOfferingMap ,
11151115 final Map <String , Long > nicNetworkMap , final Map <String , Network .IpAddresses > callerNicIpAddressMap ,
1116- final Map <String , String > details , final boolean migrateAllowed , final boolean forced , final boolean isImportUnmanagedFromSameHypervisor ) {
1116+ final Map <String , String > details , final boolean migrateAllowed , final boolean forced , final boolean isImportUnmanagedFromSameHypervisor ,
1117+ final String bootType , final String bootMode ) {
11171118 logger .debug (LogUtils .logGsonWithoutException ("Trying to import VM [%s] with name [%s], in zone [%s], cluster [%s], and host [%s], using template [%s], service offering [%s], disks map [%s], NICs map [%s] and details [%s]." ,
11181119 unmanagedInstance , instanceName , zone , cluster , host , template , serviceOffering , dataDiskOfferingMap , nicNetworkMap , details ));
11191120 UserVm userVm = null ;
@@ -1188,6 +1189,10 @@ private UserVm importVirtualMachineInternal(final UnmanagedInstanceTO unmanagedI
11881189 allDetails .put (VmDetailConstants .KVM_VNC_PASSWORD , unmanagedInstance .getVncPassword ());
11891190 }
11901191
1192+ if (StringUtils .isNotBlank (bootType ) && bootType .equalsIgnoreCase ("uefi" ) && StringUtils .isNotBlank (bootMode )) {
1193+ allDetails .put ("UEFI" , bootMode );
1194+ }
1195+
11911196 VirtualMachine .PowerState powerState = VirtualMachine .PowerState .PowerOff ;
11921197 if (unmanagedInstance .getPowerState ().equals (UnmanagedInstanceTO .PowerState .PowerOn )) {
11931198 powerState = VirtualMachine .PowerState .PowerOn ;
@@ -1564,7 +1569,8 @@ private UserVm importUnmanagedInstanceFromHypervisor(DataCenter zone, Cluster cl
15641569 template , displayName , hostName , CallContext .current ().getCallingAccount (), owner , userId ,
15651570 serviceOffering , dataDiskOfferingMap ,
15661571 nicNetworkMap , nicIpAddressMap ,
1567- details , migrateAllowed , forced , true );
1572+ details , migrateAllowed , forced , true ,
1573+ unmanagedInstance .getBootType (), unmanagedInstance .getBootMode ());
15681574 break ;
15691575 }
15701576 if (userVm != null ) {
@@ -1684,7 +1690,8 @@ protected UserVm importUnmanagedInstanceFromVmwareToKvm(DataCenter zone, Cluster
16841690 template , displayName , hostName , caller , owner , userId ,
16851691 serviceOffering , dataDiskOfferingMap ,
16861692 nicNetworkMap , nicIpAddressMap ,
1687- details , false , forced , false );
1693+ details , false , forced , false ,
1694+ sourceVMwareInstance .getBootType (), sourceVMwareInstance .getBootMode ());
16881695 long timeElapsedInSecs = (System .currentTimeMillis () - importStartTime ) / 1000 ;
16891696 logger .debug (String .format ("VMware VM %s imported successfully to CloudStack instance %s (%s), Time taken: %d secs, OVF files imported from %s, Source VMware VM details - OS: %s, PowerState: %s, Disks: %s, NICs: %s" ,
16901697 sourceVMName , instanceName , displayName , timeElapsedInSecs , (ovfTemplateOnConvertLocation != null )? "MS" : "KVM Host" , sourceVMwareInstance .getOperatingSystem (), sourceVMwareInstance .getPowerState (), sourceVMwareInstance .getDisks (), sourceVMwareInstance .getNics ()));
0 commit comments