@@ -388,7 +388,7 @@ public void doInTransactionWithoutResult(final TransactionStatus status) {
388388 }
389389 createVpcOffering (VpcOffering .defaultVPCOfferingName , VpcOffering .defaultVPCOfferingName , svcProviderMap ,
390390 true , State .Enabled , null , false ,
391- false , false , null , null , false );
391+ false , false , null , null , false , true );
392392 }
393393
394394 // configure default vpc offering with Netscaler as LB Provider
@@ -408,7 +408,7 @@ public void doInTransactionWithoutResult(final TransactionStatus status) {
408408 }
409409 }
410410 createVpcOffering (VpcOffering .defaultVPCNSOfferingName , VpcOffering .defaultVPCNSOfferingName ,
411- svcProviderMap , false , State .Enabled , null , false , false , false , null , null , false );
411+ svcProviderMap , false , State .Enabled , null , false , false , false , null , null , false , false );
412412
413413 }
414414
@@ -429,7 +429,7 @@ public void doInTransactionWithoutResult(final TransactionStatus status) {
429429 }
430430 }
431431 createVpcOffering (VpcOffering .redundantVPCOfferingName , VpcOffering .redundantVPCOfferingName , svcProviderMap , true , State .Enabled ,
432- null , false , false , true , null , null , false );
432+ null , false , false , true , null , null , false , true );
433433 }
434434
435435 // configure default vpc offering with NSX as network service provider in NAT mode
@@ -446,7 +446,7 @@ public void doInTransactionWithoutResult(final TransactionStatus status) {
446446 }
447447 }
448448 createVpcOffering (VpcOffering .DEFAULT_VPC_NAT_NSX_OFFERING_NAME , VpcOffering .DEFAULT_VPC_NAT_NSX_OFFERING_NAME , svcProviderMap , false ,
449- State .Enabled , null , false , false , false , NetworkOffering .NetworkMode .NATTED , null , false );
449+ State .Enabled , null , false , false , false , NetworkOffering .NetworkMode .NATTED , null , false , false );
450450
451451 }
452452
@@ -464,7 +464,7 @@ public void doInTransactionWithoutResult(final TransactionStatus status) {
464464 }
465465 }
466466 createVpcOffering (VpcOffering .DEFAULT_VPC_ROUTE_NSX_OFFERING_NAME , VpcOffering .DEFAULT_VPC_ROUTE_NSX_OFFERING_NAME , svcProviderMap , false ,
467- State .Enabled , null , false , false , false , NetworkOffering .NetworkMode .ROUTED , null , false );
467+ State .Enabled , null , false , false , false , NetworkOffering .NetworkMode .ROUTED , null , false , false );
468468
469469 }
470470
@@ -482,7 +482,7 @@ public void doInTransactionWithoutResult(final TransactionStatus status) {
482482 }
483483 }
484484 createVpcOffering (VpcOffering .DEFAULT_VPC_ROUTE_NETRIS_OFFERING_NAME , VpcOffering .DEFAULT_VPC_ROUTE_NETRIS_OFFERING_NAME , svcProviderMap , false ,
485- State .Enabled , null , false , false , false , NetworkOffering .NetworkMode .ROUTED , null , false );
485+ State .Enabled , null , false , false , false , NetworkOffering .NetworkMode .ROUTED , null , false , false );
486486
487487 }
488488
@@ -500,7 +500,7 @@ public void doInTransactionWithoutResult(final TransactionStatus status) {
500500 }
501501 }
502502 createVpcOffering (VpcOffering .DEFAULT_VPC_NAT_NETRIS_OFFERING_NAME , VpcOffering .DEFAULT_VPC_NAT_NETRIS_OFFERING_NAME , svcProviderMap , false ,
503- State .Enabled , null , false , false , false , NetworkOffering .NetworkMode .NATTED , null , false );
503+ State .Enabled , null , false , false , false , NetworkOffering .NetworkMode .NATTED , null , false , false );
504504
505505 }
506506 }
@@ -586,6 +586,7 @@ public VpcOffering createVpcOffering(CreateVPCOfferingCmd cmd) {
586586 }
587587 boolean specifyAsNumber = cmd .getSpecifyAsNumber ();
588588 String routingModeString = cmd .getRoutingMode ();
589+ boolean conserveMode = cmd .isConserveMode ();
589590
590591 // check if valid domain
591592 if (CollectionUtils .isNotEmpty (cmd .getDomainIds ())) {
@@ -624,15 +625,15 @@ public VpcOffering createVpcOffering(CreateVPCOfferingCmd cmd) {
624625
625626 return createVpcOffering (vpcOfferingName , displayText , supportedServices ,
626627 serviceProviderList , serviceCapabilityList , internetProtocol , serviceOfferingId , provider , networkMode ,
627- domainIds , zoneIds , (enable ? State .Enabled : State .Disabled ), routingMode , specifyAsNumber );
628+ domainIds , zoneIds , (enable ? State .Enabled : State .Disabled ), routingMode , specifyAsNumber , conserveMode );
628629 }
629630
630631 @ Override
631632 @ ActionEvent (eventType = EventTypes .EVENT_VPC_OFFERING_CREATE , eventDescription = "creating vpc offering" , create = true )
632633 public VpcOffering createVpcOffering (final String name , final String displayText , final List <String > supportedServices , final Map <String , List <String >> serviceProviders ,
633634 final Map serviceCapabilityList , final NetUtils .InternetProtocol internetProtocol , final Long serviceOfferingId ,
634635 final String externalProvider , final NetworkOffering .NetworkMode networkMode , List <Long > domainIds , List <Long > zoneIds , State state ,
635- NetworkOffering .RoutingMode routingMode , boolean specifyAsNumber ) {
636+ NetworkOffering .RoutingMode routingMode , boolean specifyAsNumber , boolean conserveMode ) {
636637
637638 if (!Ipv6Service .Ipv6OfferingCreationEnabled .value () && !(internetProtocol == null || NetUtils .InternetProtocol .IPv4 .equals (internetProtocol ))) {
638639 throw new InvalidParameterValueException (String .format ("Configuration %s needs to be enabled for creating IPv6 supported VPC offering" , Ipv6Service .Ipv6OfferingCreationEnabled .key ()));
@@ -727,7 +728,7 @@ public VpcOffering createVpcOffering(final String name, final String displayText
727728 final boolean offersRegionLevelVPC = isVpcOfferingForRegionLevelVpc (serviceCapabilityList );
728729 final boolean redundantRouter = isVpcOfferingRedundantRouter (serviceCapabilityList , redundantRouterService );
729730 final VpcOfferingVO offering = createVpcOffering (name , displayText , svcProviderMap , false , state , serviceOfferingId , supportsDistributedRouter , offersRegionLevelVPC ,
730- redundantRouter , networkMode , routingMode , specifyAsNumber );
731+ redundantRouter , networkMode , routingMode , specifyAsNumber , conserveMode );
731732
732733 if (offering != null ) {
733734 List <VpcOfferingDetailsVO > detailsVO = new ArrayList <>();
@@ -755,7 +756,7 @@ public VpcOffering createVpcOffering(final String name, final String displayText
755756 @ DB
756757 protected VpcOfferingVO createVpcOffering (final String name , final String displayText , final Map <Service , Set <Provider >> svcProviderMap ,
757758 final boolean isDefault , final State state , final Long serviceOfferingId , final boolean supportsDistributedRouter , final boolean offersRegionLevelVPC ,
758- final boolean redundantRouter , NetworkOffering .NetworkMode networkMode , NetworkOffering .RoutingMode routingMode , boolean specifyAsNumber ) {
759+ final boolean redundantRouter , NetworkOffering .NetworkMode networkMode , NetworkOffering .RoutingMode routingMode , boolean specifyAsNumber , boolean conserveMode ) {
759760
760761 return Transaction .execute (new TransactionCallback <VpcOfferingVO >() {
761762 @ Override
@@ -771,6 +772,7 @@ public VpcOfferingVO doInTransaction(final TransactionStatus status) {
771772 if (Objects .nonNull (routingMode )) {
772773 offering .setRoutingMode (routingMode );
773774 }
775+ offering .setConserveMode (conserveMode );
774776
775777 logger .debug ("Adding vpc offering " + offering );
776778 offering = _vpcOffDao .persist (offering );
0 commit comments