예제 #1
0
파일: openvz.py 프로젝트: joanmarkt/ToMaTo
	def getPrepareTasks(self):
		taskset = Device.getPrepareTasks(self)
		assign_template = tasks.Task("assign-template", self._assignTemplate, reverseFn=self._fallbackDestroy)
		assign_host = tasks.Task("assign-host", self._assignHost, reverseFn=self._fallbackDestroy)
		assign_vmid = tasks.Task("assign-vmid", self._assignVmid, reverseFn=self._fallbackDestroy, after=assign_host)
		create_vm = tasks.Task("create-vm", self._createVm, reverseFn=self._fallbackDestroy, after=assign_vmid)
		configure_vm = tasks.Task("configure-vm", self._configureVm, reverseFn=self._fallbackDestroy, after=create_vm)
		create_interfaces = tasks.Task("create-interfaces", self._createInterfaces, reverseFn=self._fallbackDestroy, after=configure_vm)
		taskset.add([assign_template, assign_host, assign_vmid, create_vm, configure_vm, create_interfaces])
		return self._adaptTaskset(taskset)
예제 #2
0
파일: kvm.py 프로젝트: joanmarkt/ToMaTo
	def getPrepareTasks(self):
		taskset = Device.getPrepareTasks(self)
		assign_template = tasks.Task("assign-template", self._assignTemplate)
		assign_host = tasks.Task("assign-host", self._assignHost)
		assign_vmid = tasks.Task("assign-vmid", self._assignVmid, after=assign_host)
		create_vm = tasks.Task("create-vm", self._createVm, reverseFn=self._fallbackDestroy, after=assign_vmid)
		use_template = tasks.Task("use-template", self._useTemplate, reverseFn=self._fallbackDestroy, after=create_vm)
		configure_vm = tasks.Task("configure-vm", self._configureVm, reverseFn=self._fallbackDestroy, after=create_vm)
		for iface in self.interfaceSetAll():
			taskset.add(tasks.Task("create-interface-%s" % iface.name, self._createIface, args=(iface,), reverseFn=self._fallbackDestroy, after=create_vm))
		taskset.add([assign_template, assign_host, assign_vmid, create_vm, use_template, configure_vm])
		return self._adaptTaskset(taskset)
예제 #3
0
파일: prog.py 프로젝트: david-hock/ToMaTo
	def getPrepareTasks(self):
		taskset = Device.getPrepareTasks(self)
		taskset.add(tasks.Task("prepare", self._prepareDev))
		return taskset