cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject git commit: updated refs/heads/4.4 to ccee282
Date Thu, 31 Jul 2014 16:50:54 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.4 f956ae976 -> ccee282a7


CLOUDSTACK-6931: Set hypervisor.type in agent.properties using cloudstack-setup -t option.
Default is kvm.

(cherry picked from commit 89854de18da62d0808363781ad27fc310eb9b8cd)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


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

Branch: refs/heads/4.4
Commit: ccee282a743c1814d7c2ff969da98d567b26bf85
Parents: f956ae9
Author: Kishan Kavala <kishan@cloud.com>
Authored: Thu Jun 19 11:30:45 2014 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Thu Jul 31 18:50:43 2014 +0200

----------------------------------------------------------------------
 agent/bindir/cloud-setup-agent.in                      | 13 ++++++++++++-
 agent/conf/agent.properties                            |  2 +-
 python/lib/cloudutils/globalEnv.py                     |  2 ++
 python/lib/cloudutils/serviceConfig.py                 |  1 +
 .../kvm/discoverer/LibvirtServerDiscoverer.java        |  1 +
 5 files changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ccee282a/agent/bindir/cloud-setup-agent.in
----------------------------------------------------------------------
diff --git a/agent/bindir/cloud-setup-agent.in b/agent/bindir/cloud-setup-agent.in
index 6932672..9ec2499 100755
--- a/agent/bindir/cloud-setup-agent.in
+++ b/agent/bindir/cloud-setup-agent.in
@@ -61,6 +61,14 @@ def getUserInputs():
     if clusterId == "":
         clusterId = oldCluster
 
+    oldHypervisor = cfo.getEntry("hypervisor")
+    if oldHypervisor == "":
+        oldHypervisor = "kvm"
+
+    hypervisor = raw_input("Please input the Hypervisor type kvm/lxc:[%s]"%oldCluster)
+    if hypervisor == "":
+        hypervisor = oldHypervisor
+
     try:
         defaultNic = networkConfig.getDefaultNetwork()
     except:
@@ -76,7 +84,7 @@ def getUserInputs():
         elif network == "":
             network = defNic
 
-    return [mgtSvr, zoneToken, network, podId, clusterId]
+    return [mgtSvr, zoneToken, network, podId, clusterId, hypervisor]
 
 if __name__ == '__main__':
     initLoging("@AGENTLOGDIR@/setup.log")
@@ -90,6 +98,7 @@ if __name__ == '__main__':
     parser.add_option("-z", "--zone", dest="zone", help="zone id")
     parser.add_option("-p", "--pod", dest="pod", help="pod id")
     parser.add_option("-c", "--cluster", dest="cluster", help="cluster id")
+    parser.add_option("-t", "--hypervisor", default="kvm", dest="hypervisor", help="hypervisor
type")
     parser.add_option("-g", "--guid", dest="guid", help="guid")
     parser.add_option("--pubNic", dest="pubNic", help="Public traffic interface")
     parser.add_option("--prvNic", dest="prvNic", help="Private traffic interface")
@@ -108,6 +117,7 @@ if __name__ == '__main__':
         glbEnv.defaultNic = userInputs[2]
         glbEnv.pod = userInputs[3]
         glbEnv.cluster = userInputs[4]
+        glbEnv.hypervisor = userInputs[5]
         #generate UUID
         glbEnv.uuid = old_config.getEntry("guid")
         if glbEnv.uuid == "":
@@ -124,6 +134,7 @@ if __name__ == '__main__':
         glbEnv.zone = options.zone
         glbEnv.pod = options.pod
         glbEnv.cluster = options.cluster
+        glbEnv.hypervisor = options.hypervisor
         glbEnv.nics.append(options.prvNic)
         glbEnv.nics.append(options.pubNic)
         glbEnv.nics.append(options.guestNic)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ccee282a/agent/conf/agent.properties
----------------------------------------------------------------------
diff --git a/agent/conf/agent.properties b/agent/conf/agent.properties
index b8b7a7c..8a01eab 100644
--- a/agent/conf/agent.properties
+++ b/agent/conf/agent.properties
@@ -93,7 +93,7 @@ domr.scripts.dir=scripts/network/domr/kvm
 #libvirt.vif.driver=com.cloud.hypervisor.kvm.resource.BridgeVifDriver
 
 # set the hypervisor type, values are: kvm, lxc
-# hypervisor.type=kvm
+hypervisor.type=kvm
 
 # set the hypervisor URI. Usually there is no need for changing this
 # For KVM: qemu:///system

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ccee282a/python/lib/cloudutils/globalEnv.py
----------------------------------------------------------------------
diff --git a/python/lib/cloudutils/globalEnv.py b/python/lib/cloudutils/globalEnv.py
index 867aa17..1f6083c 100644
--- a/python/lib/cloudutils/globalEnv.py
+++ b/python/lib/cloudutils/globalEnv.py
@@ -32,6 +32,8 @@ class globalEnv:
         self.pod = None
         #cluster id or cluster name
         self.cluster = None
+        #hypervisor type. KVM/LXC. Default is KVM
+        self.hypervisor = "kvm"
         #nics: 0: private nic, 1: guest nic, 2: public nic used by agent
         self.nics = []
         #uuid

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ccee282a/python/lib/cloudutils/serviceConfig.py
----------------------------------------------------------------------
diff --git a/python/lib/cloudutils/serviceConfig.py b/python/lib/cloudutils/serviceConfig.py
index 3c23334..e0ea7a2 100755
--- a/python/lib/cloudutils/serviceConfig.py
+++ b/python/lib/cloudutils/serviceConfig.py
@@ -671,6 +671,7 @@ class cloudAgentConfig(serviceCfgBase):
             cfo.addEntry("zone", self.syscfg.env.zone)
             cfo.addEntry("pod", self.syscfg.env.pod)
             cfo.addEntry("cluster", self.syscfg.env.cluster)
+            cfo.addEntry("hypervisor.type", self.syscfg.env.hypervisor)
             cfo.addEntry("port", "8250")
             cfo.addEntry("private.network.device", self.syscfg.env.nics[0])
             cfo.addEntry("public.network.device", self.syscfg.env.nics[1])

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ccee282a/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java b/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java
index 8eb6c89..d475f4d 100644
--- a/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java
+++ b/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java
@@ -203,6 +203,7 @@ public abstract class LibvirtServerDiscoverer extends DiscovererBase implements
             parameters += " --pubNic=" + kvmPublicNic;
             parameters += " --prvNic=" + kvmPrivateNic;
             parameters += " --guestNic=" + kvmGuestNic;
+            parameters += " --hypervisor=" + cluster.getHypervisorType().toString().toLowerCase();
 
             SSHCmdHelper.sshExecuteCmd(sshConnection, "cloudstack-setup-agent " + parameters,
3);
 


Mime
View raw message