@@ -3956,7 +3956,7 @@ private UserVm createVirtualMachine(DataCenter zone, ServiceOffering serviceOffe
39563956 DiskOfferingVO diskOffering = _diskOfferingDao .findById (diskOfferingId );
39573957 volumesSize += verifyAndGetDiskSize (diskOffering , diskSize );
39583958 }
3959- UserVm vm = getCheckedUserVmResource (zone , hostName , displayName , owner , diskOfferingId , diskSize , networkList , securityGroupIdList , group , httpmethod , userData , sshKeyPairs , caller , requestedIps , defaultIps , isDisplayVm , keyboard , affinityGroupIdList , customParameters , customId , dhcpOptionMap , datadiskTemplateToDiskOfferringMap , userVmOVFPropertiesMap , dynamicScalingEnabled , vmType , template , hypervisorType , accountId , offering , isIso , rootDiskOfferingId , volumesSize );
3959+ UserVm vm = getCheckedUserVmResource (zone , hostName , displayName , owner , diskOfferingId , diskSize , networkList , securityGroupIdList , group , httpmethod , userData , userDataId , userDataDetails , sshKeyPairs , caller , requestedIps , defaultIps , isDisplayVm , keyboard , affinityGroupIdList , customParameters , customId , dhcpOptionMap , datadiskTemplateToDiskOfferringMap , userVmOVFPropertiesMap , dynamicScalingEnabled , vmType , template , hypervisorType , accountId , offering , isIso , rootDiskOfferingId , volumesSize );
39603960
39613961 _securityGroupMgr .addInstanceToGroups (vm .getId (), securityGroupIdList );
39623962
@@ -3967,13 +3967,13 @@ private UserVm createVirtualMachine(DataCenter zone, ServiceOffering serviceOffe
39673967 CallContext .current ().putContextParameter (VirtualMachine .class , vm .getUuid ());
39683968 return vm ;
39693969 }
3970- private UserVm getCheckedUserVmResource (DataCenter zone , String hostName , String displayName , Account owner , Long diskOfferingId , Long diskSize , List <NetworkVO > networkList , List <Long > securityGroupIdList , String group , HTTPMethod httpmethod , String userData , List <String > sshKeyPairs , Account caller , Map <Long , IpAddresses > requestedIps , IpAddresses defaultIps , Boolean isDisplayVm , String keyboard , List <Long > affinityGroupIdList , Map <String , String > customParameters , String customId , Map <String , Map <Integer , String >> dhcpOptionMap , Map <Long , DiskOffering > datadiskTemplateToDiskOfferringMap , Map <String , String > userVmOVFPropertiesMap , boolean dynamicScalingEnabled , String vmType , VMTemplateVO template , HypervisorType hypervisorType , long accountId , ServiceOfferingVO offering , boolean isIso , Long rootDiskOfferingId , long volumesSize ) throws ResourceAllocationException , StorageUnavailableException , InsufficientCapacityException {
3970+ private UserVm getCheckedUserVmResource (DataCenter zone , String hostName , String displayName , Account owner , Long diskOfferingId , Long diskSize , List <NetworkVO > networkList , List <Long > securityGroupIdList , String group , HTTPMethod httpmethod , String userData , Long userDataId , String userDataDetails , List <String > sshKeyPairs , Account caller , Map <Long , IpAddresses > requestedIps , IpAddresses defaultIps , Boolean isDisplayVm , String keyboard , List <Long > affinityGroupIdList , Map <String , String > customParameters , String customId , Map <String , Map <Integer , String >> dhcpOptionMap , Map <Long , DiskOffering > datadiskTemplateToDiskOfferringMap , Map <String , String > userVmOVFPropertiesMap , boolean dynamicScalingEnabled , String vmType , VMTemplateVO template , HypervisorType hypervisorType , long accountId , ServiceOfferingVO offering , boolean isIso , Long rootDiskOfferingId , long volumesSize ) throws ResourceAllocationException , StorageUnavailableException , InsufficientCapacityException {
39713971 if (!VirtualMachineManager .ResourceCountRunningVMsonly .value ()) {
39723972 try (CheckedReservation vmReservation = new CheckedReservation (owner , ResourceType .user_vm , 1l , reservationDao , resourceLimitService );
39733973 CheckedReservation cpuReservation = new CheckedReservation (owner , ResourceType .cpu , Long .valueOf (offering .getCpu ()), reservationDao , resourceLimitService );
39743974 CheckedReservation memReservation = new CheckedReservation (owner , ResourceType .memory , Long .valueOf (offering .getRamSize ()), reservationDao , resourceLimitService );
39753975 ) {
3976- return getUncheckedUserVmResource (zone , hostName , displayName , owner , diskOfferingId , diskSize , networkList , securityGroupIdList , group , httpmethod , userData , sshKeyPairs , caller , requestedIps , defaultIps , isDisplayVm , keyboard , affinityGroupIdList , customParameters , customId , dhcpOptionMap , datadiskTemplateToDiskOfferringMap , userVmOVFPropertiesMap , dynamicScalingEnabled , vmType , template , hypervisorType , accountId , offering , isIso , rootDiskOfferingId , volumesSize );
3976+ return getUncheckedUserVmResource (zone , hostName , displayName , owner , diskOfferingId , diskSize , networkList , securityGroupIdList , group , httpmethod , userData , userDataId , userDataDetails , sshKeyPairs , caller , requestedIps , defaultIps , isDisplayVm , keyboard , affinityGroupIdList , customParameters , customId , dhcpOptionMap , datadiskTemplateToDiskOfferringMap , userVmOVFPropertiesMap , dynamicScalingEnabled , vmType , template , hypervisorType , accountId , offering , isIso , rootDiskOfferingId , volumesSize );
39773977 } catch (ResourceAllocationException | CloudRuntimeException e ) {
39783978 throw e ;
39793979 } catch (Exception e ) {
@@ -3982,11 +3982,11 @@ private UserVm getCheckedUserVmResource(DataCenter zone, String hostName, String
39823982 }
39833983
39843984 } else {
3985- return getUncheckedUserVmResource (zone , hostName , displayName , owner , diskOfferingId , diskSize , networkList , securityGroupIdList , group , httpmethod , userData , sshKeyPairs , caller , requestedIps , defaultIps , isDisplayVm , keyboard , affinityGroupIdList , customParameters , customId , dhcpOptionMap , datadiskTemplateToDiskOfferringMap , userVmOVFPropertiesMap , dynamicScalingEnabled , vmType , template , hypervisorType , accountId , offering , isIso , rootDiskOfferingId , volumesSize );
3985+ return getUncheckedUserVmResource (zone , hostName , displayName , owner , diskOfferingId , diskSize , networkList , securityGroupIdList , group , httpmethod , userData , userDataId , userDataDetails , sshKeyPairs , caller , requestedIps , defaultIps , isDisplayVm , keyboard , affinityGroupIdList , customParameters , customId , dhcpOptionMap , datadiskTemplateToDiskOfferringMap , userVmOVFPropertiesMap , dynamicScalingEnabled , vmType , template , hypervisorType , accountId , offering , isIso , rootDiskOfferingId , volumesSize );
39863986 }
39873987 }
39883988
3989- private UserVm getUncheckedUserVmResource (DataCenter zone , String hostName , String displayName , Account owner , Long diskOfferingId , Long diskSize , List <NetworkVO > networkList , List <Long > securityGroupIdList , String group , HTTPMethod httpmethod , String userData , List <String > sshKeyPairs , Account caller , Map <Long , IpAddresses > requestedIps , IpAddresses defaultIps , Boolean isDisplayVm , String keyboard , List <Long > affinityGroupIdList , Map <String , String > customParameters , String customId , Map <String , Map <Integer , String >> dhcpOptionMap , Map <Long , DiskOffering > datadiskTemplateToDiskOfferringMap , Map <String , String > userVmOVFPropertiesMap , boolean dynamicScalingEnabled , String vmType , VMTemplateVO template , HypervisorType hypervisorType , long accountId , ServiceOfferingVO offering , boolean isIso , Long rootDiskOfferingId , long volumesSize ) throws ResourceAllocationException , StorageUnavailableException , InsufficientCapacityException {
3989+ private UserVm getUncheckedUserVmResource (DataCenter zone , String hostName , String displayName , Account owner , Long diskOfferingId , Long diskSize , List <NetworkVO > networkList , List <Long > securityGroupIdList , String group , HTTPMethod httpmethod , String userData , Long userDataId , String userDataDetails , List <String > sshKeyPairs , Account caller , Map <Long , IpAddresses > requestedIps , IpAddresses defaultIps , Boolean isDisplayVm , String keyboard , List <Long > affinityGroupIdList , Map <String , String > customParameters , String customId , Map <String , Map <Integer , String >> dhcpOptionMap , Map <Long , DiskOffering > datadiskTemplateToDiskOfferringMap , Map <String , String > userVmOVFPropertiesMap , boolean dynamicScalingEnabled , String vmType , VMTemplateVO template , HypervisorType hypervisorType , long accountId , ServiceOfferingVO offering , boolean isIso , Long rootDiskOfferingId , long volumesSize ) throws ResourceAllocationException , StorageUnavailableException , InsufficientCapacityException {
39903990 try (CheckedReservation volumeReservation = new CheckedReservation (owner , ResourceType .volume , (isIso || diskOfferingId == null ? 1l : 2 ), reservationDao , resourceLimitService );
39913991 CheckedReservation primaryStorageReservation = new CheckedReservation (owner , ResourceType .primary_storage , volumesSize , reservationDao , resourceLimitService )) {
39923992
0 commit comments