コード例 #1
0
	def __createConfigFile(vm, env):
		template_name = "kvm.template.xml"
		template = env.get_template(template_name)	

		# Set vars&render		
		output = template.render(vm_name=vm.name, vm_uuid=vm.uuid,
								vm_memory=vm.xen_configuration.memory_mb,
								vm_cpu=str(1),
								vm_imgfile=HdManager.getHdPath(vm),
								vm=vm)	
			
		# write file
		cfile = open(HdManager.getConfigFilePath(vm), 'w')
		cfile.write(output)
		cfile.close()
コード例 #2
0
	def __createConfigFile(vm,env):
		template_name = "spirentSTCVMTemplate.pt"
		template = env.get_template(template_name)	

		#Set vars&render		
		output = template.render(
		kernelImg=OXA_KVM_SERVER_KERNEL,
		initrdImg=OXA_KVM_SERVER_INITRD,
		hdFilePath=HdManager.getHdPath(vm),
		#swapFilePath=HdManager.getSwapPath(vm),
		vm=vm)	
			
		#write file
		cfile = open(HdManager.getConfigFilePath(vm),'w')
		cfile.write(output)
		cfile.close()