def stopVM(id,vm):
		try:
			#Just try to stop
			XendManager.stopDomain(vm)
	
			XenProvisioningDispatcher.logger.info("VM named "+vm.name+" has been stopped.")
			#Send async notification
			XmlRpcClient.sendAsyncProvisioningActionStatus(id,"SUCCESS","")
		except Exception as e:
			XenProvisioningDispatcher.logger.error(str(e))
			#Send async notification
			XmlRpcClient.sendAsyncProvisioningActionStatus(id,"FAILED",str(e))
			return
Beispiel #2
0
    def stopVM(id, vm):
        try:
            #Just try to stop
            XendManager.stopDomain(vm)

            XenProvisioningDispatcher.logger.info("VM named " + vm.name +
                                                  " has been stopped.")
            #Send async notification
            XmlRpcClient.sendAsyncProvisioningActionStatus(id, "SUCCESS", "")
        except Exception as e:
            XenProvisioningDispatcher.logger.error(str(e))
            #Send async notification
            XmlRpcClient.sendAsyncProvisioningActionStatus(
                id, "FAILED", str(e))
            return
	def deleteVM(id,vm):
		try:
			try:
				#if it wasn't stopped, do it
				XendManager.stopDomain(vm)	
			except Exception as e:
				pass
			
			#Trigger Hd Deletion in Remote	
			HdManager.delete(vm)	

			#Send async notification
			XmlRpcClient.sendAsyncProvisioningActionStatus(id,"SUCCESS","")
		except Exception as e:
			XenProvisioningDispatcher.logger.error(str(e))
			#Send async notification
			XmlRpcClient.sendAsyncProvisioningActionStatus(id,"FAILED",str(e))
			return
Beispiel #4
0
    def deleteVM(id, vm):
        try:
            try:
                #if it wasn't stopped, do it
                XendManager.stopDomain(vm)
            except Exception as e:
                pass

            #Trigger Hd Deletion in Remote
            HdManager.delete(vm)

            #Send async notification
            XmlRpcClient.sendAsyncProvisioningActionStatus(id, "SUCCESS", "")
        except Exception as e:
            XenProvisioningDispatcher.logger.error(str(e))
            #Send async notification
            XmlRpcClient.sendAsyncProvisioningActionStatus(
                id, "FAILED", str(e))
            return