cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject [2/2] git commit: updated refs/heads/master to 2072026
Date Thu, 20 Jun 2013 17:38:06 GMT
CLOUDSTACK-3091: expect UUID instead of actual DB id, when read internallbvm.service.offering
global config


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/bf331064
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/bf331064
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/bf331064

Branch: refs/heads/master
Commit: bf331064a259fef7a3a6dcc4f88dc0c3a71230a1
Parents: cd221fc
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Thu Jun 20 10:06:33 2013 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Thu Jun 20 10:37:59 2013 -0700

----------------------------------------------------------------------
 .../lb/InternalLoadBalancerVMManagerImpl.java    | 19 ++++++++++++++-----
 server/src/com/cloud/configuration/Config.java   |  2 +-
 2 files changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bf331064/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
b/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
index d0a9771..2bdb28f 100644
--- a/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
+++ b/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
@@ -129,7 +129,7 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements
     private String _instance;
     private String _mgmtHost;
     private String _mgmtCidr;
-    private long _internalLbVmOfferingId;
+    private long _internalLbVmOfferingId = 0L;
     
     @Inject VirtualMachineManager _itMgr;
     @Inject DomainRouterDao _internalLbVmDao;
@@ -394,10 +394,19 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements
         _mgmtHost = configs.get("host");
         _mgmtCidr = _configDao.getValue(Config.ManagementNetwork.key());
         
-        String offIdStr = configs.get(Config.InternalLbVmServiceOfferingId.key());
-        if (offIdStr != null && !offIdStr.isEmpty()) {
-            _internalLbVmOfferingId = Long.parseLong(offIdStr);
-        } else {
+        String offUUID = configs.get(Config.InternalLbVmServiceOfferingId.key());
+        if (offUUID != null && !offUUID.isEmpty()) {
+            //get the id by offering UUID
+            ServiceOfferingVO off = _serviceOfferingDao.findByUuid(offUUID);
+            if (off != null) {
+                _internalLbVmOfferingId = off.getId();
+            } else {
+                s_logger.warn("Invalid offering UUID is passed in " + Config.InternalLbVmServiceOfferingId.key()
+ "; the default offering will be used instead");
+            }
+        }
+        
+        //if offering wasn't set, try to get the default one
+        if (_internalLbVmOfferingId == 0L) {
             boolean useLocalStorage = Boolean.parseBoolean(configs.get(Config.SystemVMUseLocalStorage.key()));
             ServiceOfferingVO newOff = new ServiceOfferingVO("System Offering For Internal
LB VM", 1, InternalLoadBalancerVMManager.DEFAULT_INTERNALLB_VM_RAMSIZE, InternalLoadBalancerVMManager.DEFAULT_INTERNALLB_VM_CPU_MHZ,
null,
                     null, true, null, useLocalStorage, true, null, true, VirtualMachine.Type.InternalLoadBalancerVm,
true);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bf331064/server/src/com/cloud/configuration/Config.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java
index f14a76c..a22f8a5 100755
--- a/server/src/com/cloud/configuration/Config.java
+++ b/server/src/com/cloud/configuration/Config.java
@@ -431,7 +431,7 @@ public enum Config {
     BlacklistedRoutes("Advanced", VpcManager.class, String.class, "blacklisted.routes", null,
"Routes that are blacklisted, can not be used for Static Routes creation for the VPC Private
Gateway",
 	           "routes", ConfigurationParameterScope.zone.toString()),
 	
-    InternalLbVmServiceOfferingId("Advanced", ManagementServer.class, Long.class, "internallbvm.service.offering",
null, "Uuid of the service offering used by internal lb vm; if NULL - default system internal
lb offering will be used", null),
+    InternalLbVmServiceOfferingId("Advanced", ManagementServer.class, String.class, "internallbvm.service.offering",
null, "Uuid of the service offering used by internal lb vm; if NULL - default system internal
lb offering will be used", null),
     ExecuteInSequence("Advanced", ManagementServer.class, Boolean.class, "execute.in.sequence.hypervisor.commands",
"false", "If set to true, StartCommand, StopCommand, CopyVolumeCommand, CreateCommand will
be synchronized on the agent side." +
     		" If set to false, these commands become asynchronous. Default value is false.", null),
     ExecuteInSequenceNetworkElementCommands("Advanced", NetworkManager.class, Boolean.class,
"execute.in.sequence.network.element.commands", "false", "If set to true, DhcpEntryCommand,
SavePasswordCommand, UserDataCommand, VmDataCommand will be synchronized on the agent side."
+ 


Mime
View raw message