mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	xcp-ng: fix vm boot options (#5543)
* xcp-ng: fix vm boot options Use value boot option values from VM details directly similar to other hypervisor plugins instead of relying on boot properties explicitly set for VirtualMachineTO. Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com> Co-authored-by: Harikrishna Patnala <harikrishna.patnala@gmail.com>
This commit is contained in:
		
							parent
							
								
									6ac834a358
								
							
						
					
					
						commit
						2a42a01728
					
				| @ -1426,7 +1426,9 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe | ||||
|             throw new CloudRuntimeException("Unable to finalize VM MetaData: " + vmSpec); | ||||
|         } | ||||
|         try { | ||||
|             setVmBootDetails(vm, conn, vmSpec.getBootType(), vmSpec.getBootMode()); | ||||
|             String bootMode = org.apache.commons.lang3.StringUtils.defaultIfEmpty(vmSpec.getDetails().get(ApiConstants.BootType.UEFI.toString()), null); | ||||
|             String bootType = (bootMode == null) ? ApiConstants.BootType.BIOS.toString() : ApiConstants.BootType.UEFI.toString(); | ||||
|             setVmBootDetails(vm, conn, bootType, bootMode); | ||||
|         } catch (final XenAPIException | XmlRpcException e) { | ||||
|             throw new CloudRuntimeException(String.format("Unable to handle VM boot options: %s", vmSpec), e); | ||||
|         } | ||||
| @ -1938,9 +1940,6 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe | ||||
|     } | ||||
| 
 | ||||
|     protected void setVmBootDetails(final VM vm, final Connection conn, String bootType, String bootMode) throws XenAPIException, XmlRpcException { | ||||
|         if (!ApiConstants.BootType.UEFI.toString().equals(bootType)) { | ||||
|             bootType = ApiConstants.BootType.BIOS.toString(); | ||||
|         } | ||||
|         if (s_logger.isDebugEnabled()) { | ||||
|             s_logger.debug(String.format("Setting boottype=%s and bootmode=%s for VM: %s", bootType, bootMode, vm.getUuid(conn))); | ||||
|         } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user