@@ -61,6 +61,14 @@ def getUserInputs():
6161 if clusterId == "" :
6262 clusterId = oldCluster
6363
64+ oldHypervisor = cfo .getEntry ("hypervisor" )
65+ if oldHypervisor == "" :
66+ oldHypervisor = "kvm"
67+
68+ hypervisor = raw_input ("Please input the Hypervisor type kvm/lxc:[%s]" % oldCluster )
69+ if hypervisor == "" :
70+ hypervisor = oldHypervisor
71+
6472 try :
6573 defaultNic = networkConfig .getDefaultNetwork ()
6674 except :
@@ -76,7 +84,7 @@ def getUserInputs():
7684 elif network == "" :
7785 network = defNic
7886
79- return [mgtSvr , zoneToken , network , podId , clusterId ]
87+ return [mgtSvr , zoneToken , network , podId , clusterId , hypervisor ]
8088
8189if __name__ == '__main__' :
8290 initLoging ("@AGENTLOGDIR@/setup.log" )
@@ -90,6 +98,7 @@ if __name__ == '__main__':
9098 parser .add_option ("-z" , "--zone" , dest = "zone" , help = "zone id" )
9199 parser .add_option ("-p" , "--pod" , dest = "pod" , help = "pod id" )
92100 parser .add_option ("-c" , "--cluster" , dest = "cluster" , help = "cluster id" )
101+ parser .add_option ("-t" , "--hypervisor" , default = "kvm" , dest = "hypervisor" , help = "hypervisor type" )
93102 parser .add_option ("-g" , "--guid" , dest = "guid" , help = "guid" )
94103 parser .add_option ("--pubNic" , dest = "pubNic" , help = "Public traffic interface" )
95104 parser .add_option ("--prvNic" , dest = "prvNic" , help = "Private traffic interface" )
@@ -108,6 +117,7 @@ if __name__ == '__main__':
108117 glbEnv .defaultNic = userInputs [2 ]
109118 glbEnv .pod = userInputs [3 ]
110119 glbEnv .cluster = userInputs [4 ]
120+ glbEnv .hypervisor = userInputs [5 ]
111121 #generate UUID
112122 glbEnv .uuid = old_config .getEntry ("guid" )
113123 if glbEnv .uuid == "" :
@@ -124,6 +134,7 @@ if __name__ == '__main__':
124134 glbEnv .zone = options .zone
125135 glbEnv .pod = options .pod
126136 glbEnv .cluster = options .cluster
137+ glbEnv .hypervisor = options .hypervisor
127138 glbEnv .nics .append (options .prvNic )
128139 glbEnv .nics .append (options .pubNic )
129140 glbEnv .nics .append (options .guestNic )
0 commit comments