Exemplo n.º 1
0
 def createVm(self, vmParams, vmRecover=False):
     with self.vmContainerLock:
         if not vmRecover:
             if vmParams['vmId'] in self.vmContainer:
                 return errCode['exist']
         vm = Vm(self, vmParams, vmRecover)
         self.vmContainer[vmParams['vmId']] = vm
     vm.run()
     return {'status': doneCode, 'vmList': vm.status()}
Exemplo n.º 2
0
 def createVm(self, vmParams, vmRecover=False):
     with self.vmContainerLock:
         if not vmRecover:
             if vmParams['vmId'] in self.vmContainer:
                 return errCode['exist']
         vm = Vm(self, vmParams, vmRecover)
         self.vmContainer[vmParams['vmId']] = vm
     vm.run()
     return {'status': doneCode, 'vmList': vm.status()}
Exemplo n.º 3
0
 def createVm(self, vmParams, vmRecover=False):
     with self.vmContainerLock:
         if not vmRecover:
             if vmParams['vmId'] in self.vmContainer:
                 return errCode['exist']
         vm = Vm(self, vmParams, vmRecover)
         self.vmContainer[vmParams['vmId']] = vm
     return vm.run()
Exemplo n.º 4
0
 def createVm(self, vmParams, vmRecover=False):
     with self.vmContainerLock:
         self.log.info("vmContainerLock acquired by vm %s",
                       vmParams['vmId'])
         try:
             if not vmRecover:
                 if vmParams['vmId'] in self.vmContainer:
                     self.log.warning('vm %s already exists' %
                                      vmParams['vmId'])
                     return errCode['exist']
             vm = Vm(self, vmParams, vmRecover)
             self.vmContainer[vmParams['vmId']] = vm
         finally:
             container_len = len(self.vmContainer)
     vm.run()
     self.log.debug("Total desktops after creation of %s is %d" %
                    (vmParams['vmId'], container_len))
     return {'status': doneCode, 'vmList': vm.status()}
Exemplo n.º 5
0
 def createVm(self, vmParams, vmRecover=False):
     with self.vmContainerLock:
         self.log.info("vmContainerLock acquired by vm %s",
                       vmParams['vmId'])
         try:
             if not vmRecover:
                 if vmParams['vmId'] in self.vmContainer:
                     self.log.warning('vm %s already exists' %
                                      vmParams['vmId'])
                     return errCode['exist']
             vm = Vm(self, vmParams, vmRecover)
             self.vmContainer[vmParams['vmId']] = vm
         finally:
             container_len = len(self.vmContainer)
     vm.run()
     self.log.debug("Total desktops after creation of %s is %d" %
                    (vmParams['vmId'], container_len))
     return {'status': doneCode, 'vmList': vm.status()}
Exemplo n.º 6
0
 def createVm(self, vmParams, vmRecover=False):
     with self.vmContainerLock:
         if not vmRecover:
             if vmParams['vmId'] in self.vmContainer:
                 return errCode['exist']
         vm = Vm(self, vmParams, vmRecover)
         ret = vm.run()
         if not response.is_error(ret):
             self.vmContainer[vmParams['vmId']] = vm
         return ret
Exemplo n.º 7
0
 def createVm(self, vmParams, vmRecover=False):
     with self.vmContainerLock:
         if not vmRecover:
             if vmParams['vmId'] in self.vmContainer:
                 return errCode['exist']
         vm = Vm(self, vmParams, vmRecover)
         ret = vm.run()
         if not response.is_error(ret):
             self.vmContainer[vmParams['vmId']] = vm
         return ret