class LibVirtClient {

	public boolean createVM(String vmName,
							  UUID   vmUuid,
			                  Flavor flavor,
	                          String vmImage) throws Exception {
		String  template;
		Connect conn;
		
		try {
			log.info("[LibVirtClient] Connecting to local hypervisor");
			conn = new Connect("qemu+tcp://127.0.0.1/system");
			
			log.info("Creating template");
			template = buildTemplate(
				vmName, vmUuid, flavor.getMemory(),flavor.getvCpu(), vmImage);
			
			log.info("[LibVirtClient] Resulting template: \n" + template);
			log.info("[LibVirtClient] Creating VM");
			Domain domain = conn.domainCreateXML(template, 0);
			
			conn.close();
			
			// TODO get image size
			updateQuota(-flavor.getvCpu(), -0);
		} catch (LibvirtException e) {
			mManager.monitoringPublish("There has been a problem creating the VM");
			e.printStackTrace();
			return false;
		}
		
		return true;
	}

	public  LibVirtClient();

}