@Test public void testGetVmStat() throws LibvirtException { final Connect connect = Mockito.mock(Connect.class); final Domain domain = Mockito.mock(Domain.class); final DomainInfo domainInfo = new DomainInfo(); Mockito.when(domain.getInfo()).thenReturn(domainInfo); Mockito.when(connect.domainLookupByName(VMNAME)).thenReturn(domain); final NodeInfo nodeInfo = new NodeInfo(); nodeInfo.cpus = 8; nodeInfo.memory = 8 * 1024 * 1024; nodeInfo.sockets = 2; nodeInfo.threads = 2; nodeInfo.model = "Foo processor"; Mockito.when(connect.nodeInfo()).thenReturn(nodeInfo); Mockito.when(domain.interfaceStats(Matchers.anyString())).thenAnswer( new org.mockito.stubbing.Answer<DomainInterfaceStats>() { final static int increment = 1000; int rxBytes = 1000; int txBytes = 1000; @Override public DomainInterfaceStats answer(final InvocationOnMock invocation) throws Throwable { final DomainInterfaceStats domainInterfaceStats = new DomainInterfaceStats(); domainInterfaceStats.rx_bytes = this.rxBytes += increment; domainInterfaceStats.tx_bytes = this.txBytes += increment; return domainInterfaceStats; } }); Mockito.when(domain.blockStats(Matchers.anyString())).thenAnswer( new org.mockito.stubbing.Answer<DomainBlockStats>() { final static int increment = 1000; int rdBytes = 0; int wrBytes = 1024; @Override public DomainBlockStats answer(final InvocationOnMock invocation) throws Throwable { final DomainBlockStats domainBlockStats = new DomainBlockStats(); domainBlockStats.rd_bytes = this.rdBytes += increment; domainBlockStats.wr_bytes = this.wrBytes += increment; return domainBlockStats; } }); final LibvirtComputingResource libvirtComputingResource = new LibvirtComputingResource() { @Override public List<InterfaceDef> getInterfaces(final Connect conn, final String vmName) { final InterfaceDef interfaceDef = new InterfaceDef(); return Arrays.asList(interfaceDef); } @Override public List<LibvirtDiskDef> getDisks(final Connect conn, final String vmName) { final LibvirtDiskDef diskDef = new LibvirtDiskDef(); return Arrays.asList(diskDef); } }; libvirtComputingResource.getVmStat(connect, VMNAME); final VmStatsEntry vmStat = libvirtComputingResource.getVmStat(connect, VMNAME); Assert.assertTrue(vmStat.getNetworkReadKBs() > 0); Assert.assertTrue(vmStat.getNetworkWriteKBs() > 0); Assert.assertTrue(vmStat.getDiskReadKBs() > 0); Assert.assertTrue(vmStat.getDiskWriteKBs() > 0); }
public VmStatsEntry getVmStat(final Connect conn, final String vmName) throws LibvirtException { Domain dm = null; try { dm = getDomain(conn, vmName); final DomainInfo info = dm.getInfo(); final VmStatsEntry stats = new VmStatsEntry(); stats.setNumCPUs(info.nrVirtCpu); stats.setEntityType("vm"); VmStats oldStats = null; final Calendar now = Calendar.getInstance(); oldStats = this.vmStats.get(vmName); long elapsedTime = 0; if (oldStats != null) { elapsedTime = now.getTimeInMillis() - oldStats.timestamp.getTimeInMillis(); double utilization = (info.cpuTime - oldStats.usedTime) / ((double) elapsedTime * 1000000); final NodeInfo node = conn.nodeInfo(); utilization = utilization / node.cpus; if (utilization > 0) { stats.setCPUUtilization(utilization * 100); } } final List<InterfaceDef> vifs = getInterfaces(conn, vmName); long rx = 0; long tx = 0; for (final InterfaceDef vif : vifs) { final DomainInterfaceStats ifStats = dm.interfaceStats(vif.getDevName()); rx += ifStats.rx_bytes; tx += ifStats.tx_bytes; } if (oldStats != null) { final double deltarx = rx - oldStats.rx; if (deltarx > 0) { stats.setNetworkReadKBs(deltarx / 1024); } final double deltatx = tx - oldStats.tx; if (deltatx > 0) { stats.setNetworkWriteKBs(deltatx / 1024); } } final List<LibvirtDiskDef> disks = getDisks(conn, vmName); long ioRd = 0; long ioWr = 0; long bytesRd = 0; long bytesWr = 0; for (final LibvirtDiskDef disk : disks) { if (disk.getDeviceType() == DeviceType.CDROM || disk.getDeviceType() == DeviceType.FLOPPY) { continue; } final DomainBlockStats blockStats = dm.blockStats(disk.getDiskLabel()); ioRd += blockStats.rd_req; ioWr += blockStats.wr_req; bytesRd += blockStats.rd_bytes; bytesWr += blockStats.wr_bytes; } if (oldStats != null) { final long deltaiord = ioRd - oldStats.ioRead; if (deltaiord > 0) { stats.setDiskReadIOs(deltaiord); } final long deltaiowr = ioWr - oldStats.ioWrote; if (deltaiowr > 0) { stats.setDiskWriteIOs(deltaiowr); } final double deltabytesrd = bytesRd - oldStats.bytesRead; if (deltabytesrd > 0) { stats.setDiskReadKBs(deltabytesrd / 1024); } final double deltabyteswr = bytesWr - oldStats.bytesWrote; if (deltabyteswr > 0) { stats.setDiskWriteKBs(deltabyteswr / 1024); } } final VmStats newStat = new VmStats(); newStat.usedTime = info.cpuTime; newStat.rx = rx; newStat.tx = tx; newStat.ioRead = ioRd; newStat.ioWrote = ioWr; newStat.bytesRead = bytesRd; newStat.bytesWrote = bytesWr; newStat.timestamp = now; this.vmStats.put(vmName, newStat); return stats; } finally { if (dm != null) { dm.free(); } } }
LibvirtComputingResource extends AgentResourceBase implements AgentResource, VirtualRouterDeployer { public VmStatsEntry getVmStat(final Connect conn, final String vmName) throws LibvirtException { Domain dm = null; try { dm = getDomain(conn, vmName); final DomainInfo info = dm.getInfo(); final VmStatsEntry stats = new VmStatsEntry(); stats.setNumCPUs(info.nrVirtCpu); stats.setEntityType("vm"); VmStats oldStats = null; final Calendar now = Calendar.getInstance(); oldStats = this.vmStats.get(vmName); long elapsedTime = 0; if (oldStats != null) { elapsedTime = now.getTimeInMillis() - oldStats.timestamp.getTimeInMillis(); double utilization = (info.cpuTime - oldStats.usedTime) / ((double) elapsedTime * 1000000); final NodeInfo node = conn.nodeInfo(); utilization = utilization / node.cpus; if (utilization > 0) { stats.setCPUUtilization(utilization * 100); } } final List<InterfaceDef> vifs = getInterfaces(conn, vmName); long rx = 0; long tx = 0; for (final InterfaceDef vif : vifs) { final DomainInterfaceStats ifStats = dm.interfaceStats(vif.getDevName()); rx += ifStats.rx_bytes; tx += ifStats.tx_bytes; } if (oldStats != null) { final double deltarx = rx - oldStats.rx; if (deltarx > 0) { stats.setNetworkReadKBs(deltarx / 1024); } final double deltatx = tx - oldStats.tx; if (deltatx > 0) { stats.setNetworkWriteKBs(deltatx / 1024); } } final List<LibvirtDiskDef> disks = getDisks(conn, vmName); long ioRd = 0; long ioWr = 0; long bytesRd = 0; long bytesWr = 0; for (final LibvirtDiskDef disk : disks) { if (disk.getDeviceType() == DeviceType.CDROM || disk.getDeviceType() == DeviceType.FLOPPY) { continue; } final DomainBlockStats blockStats = dm.blockStats(disk.getDiskLabel()); ioRd += blockStats.rd_req; ioWr += blockStats.wr_req; bytesRd += blockStats.rd_bytes; bytesWr += blockStats.wr_bytes; } if (oldStats != null) { final long deltaiord = ioRd - oldStats.ioRead; if (deltaiord > 0) { stats.setDiskReadIOs(deltaiord); } final long deltaiowr = ioWr - oldStats.ioWrote; if (deltaiowr > 0) { stats.setDiskWriteIOs(deltaiowr); } final double deltabytesrd = bytesRd - oldStats.bytesRead; if (deltabytesrd > 0) { stats.setDiskReadKBs(deltabytesrd / 1024); } final double deltabyteswr = bytesWr - oldStats.bytesWrote; if (deltabyteswr > 0) { stats.setDiskWriteKBs(deltabyteswr / 1024); } } final VmStats newStat = new VmStats(); newStat.usedTime = info.cpuTime; newStat.rx = rx; newStat.tx = tx; newStat.ioRead = ioRd; newStat.ioWrote = ioWr; newStat.bytesRead = bytesRd; newStat.bytesWrote = bytesWr; newStat.timestamp = now; this.vmStats.put(vmName, newStat); return stats; } finally { if (dm != null) { dm.free(); } } } }
LibvirtComputingResource extends AgentResourceBase implements AgentResource, VirtualRouterDeployer { public VmStatsEntry getVmStat(final Connect conn, final String vmName) throws LibvirtException { Domain dm = null; try { dm = getDomain(conn, vmName); final DomainInfo info = dm.getInfo(); final VmStatsEntry stats = new VmStatsEntry(); stats.setNumCPUs(info.nrVirtCpu); stats.setEntityType("vm"); VmStats oldStats = null; final Calendar now = Calendar.getInstance(); oldStats = this.vmStats.get(vmName); long elapsedTime = 0; if (oldStats != null) { elapsedTime = now.getTimeInMillis() - oldStats.timestamp.getTimeInMillis(); double utilization = (info.cpuTime - oldStats.usedTime) / ((double) elapsedTime * 1000000); final NodeInfo node = conn.nodeInfo(); utilization = utilization / node.cpus; if (utilization > 0) { stats.setCPUUtilization(utilization * 100); } } final List<InterfaceDef> vifs = getInterfaces(conn, vmName); long rx = 0; long tx = 0; for (final InterfaceDef vif : vifs) { final DomainInterfaceStats ifStats = dm.interfaceStats(vif.getDevName()); rx += ifStats.rx_bytes; tx += ifStats.tx_bytes; } if (oldStats != null) { final double deltarx = rx - oldStats.rx; if (deltarx > 0) { stats.setNetworkReadKBs(deltarx / 1024); } final double deltatx = tx - oldStats.tx; if (deltatx > 0) { stats.setNetworkWriteKBs(deltatx / 1024); } } final List<LibvirtDiskDef> disks = getDisks(conn, vmName); long ioRd = 0; long ioWr = 0; long bytesRd = 0; long bytesWr = 0; for (final LibvirtDiskDef disk : disks) { if (disk.getDeviceType() == DeviceType.CDROM || disk.getDeviceType() == DeviceType.FLOPPY) { continue; } final DomainBlockStats blockStats = dm.blockStats(disk.getDiskLabel()); ioRd += blockStats.rd_req; ioWr += blockStats.wr_req; bytesRd += blockStats.rd_bytes; bytesWr += blockStats.wr_bytes; } if (oldStats != null) { final long deltaiord = ioRd - oldStats.ioRead; if (deltaiord > 0) { stats.setDiskReadIOs(deltaiord); } final long deltaiowr = ioWr - oldStats.ioWrote; if (deltaiowr > 0) { stats.setDiskWriteIOs(deltaiowr); } final double deltabytesrd = bytesRd - oldStats.bytesRead; if (deltabytesrd > 0) { stats.setDiskReadKBs(deltabytesrd / 1024); } final double deltabyteswr = bytesWr - oldStats.bytesWrote; if (deltabyteswr > 0) { stats.setDiskWriteKBs(deltabyteswr / 1024); } } final VmStats newStat = new VmStats(); newStat.usedTime = info.cpuTime; newStat.rx = rx; newStat.tx = tx; newStat.ioRead = ioRd; newStat.ioWrote = ioWr; newStat.bytesRead = bytesRd; newStat.bytesWrote = bytesWr; newStat.timestamp = now; this.vmStats.put(vmName, newStat); return stats; } finally { if (dm != null) { dm.free(); } } }  }
LibvirtComputingResource extends AgentResourceBase implements AgentResource, VirtualRouterDeployer { public VmStatsEntry getVmStat(final Connect conn, final String vmName) throws LibvirtException { Domain dm = null; try { dm = getDomain(conn, vmName); final DomainInfo info = dm.getInfo(); final VmStatsEntry stats = new VmStatsEntry(); stats.setNumCPUs(info.nrVirtCpu); stats.setEntityType("vm"); VmStats oldStats = null; final Calendar now = Calendar.getInstance(); oldStats = this.vmStats.get(vmName); long elapsedTime = 0; if (oldStats != null) { elapsedTime = now.getTimeInMillis() - oldStats.timestamp.getTimeInMillis(); double utilization = (info.cpuTime - oldStats.usedTime) / ((double) elapsedTime * 1000000); final NodeInfo node = conn.nodeInfo(); utilization = utilization / node.cpus; if (utilization > 0) { stats.setCPUUtilization(utilization * 100); } } final List<InterfaceDef> vifs = getInterfaces(conn, vmName); long rx = 0; long tx = 0; for (final InterfaceDef vif : vifs) { final DomainInterfaceStats ifStats = dm.interfaceStats(vif.getDevName()); rx += ifStats.rx_bytes; tx += ifStats.tx_bytes; } if (oldStats != null) { final double deltarx = rx - oldStats.rx; if (deltarx > 0) { stats.setNetworkReadKBs(deltarx / 1024); } final double deltatx = tx - oldStats.tx; if (deltatx > 0) { stats.setNetworkWriteKBs(deltatx / 1024); } } final List<LibvirtDiskDef> disks = getDisks(conn, vmName); long ioRd = 0; long ioWr = 0; long bytesRd = 0; long bytesWr = 0; for (final LibvirtDiskDef disk : disks) { if (disk.getDeviceType() == DeviceType.CDROM || disk.getDeviceType() == DeviceType.FLOPPY) { continue; } final DomainBlockStats blockStats = dm.blockStats(disk.getDiskLabel()); ioRd += blockStats.rd_req; ioWr += blockStats.wr_req; bytesRd += blockStats.rd_bytes; bytesWr += blockStats.wr_bytes; } if (oldStats != null) { final long deltaiord = ioRd - oldStats.ioRead; if (deltaiord > 0) { stats.setDiskReadIOs(deltaiord); } final long deltaiowr = ioWr - oldStats.ioWrote; if (deltaiowr > 0) { stats.setDiskWriteIOs(deltaiowr); } final double deltabytesrd = bytesRd - oldStats.bytesRead; if (deltabytesrd > 0) { stats.setDiskReadKBs(deltabytesrd / 1024); } final double deltabyteswr = bytesWr - oldStats.bytesWrote; if (deltabyteswr > 0) { stats.setDiskWriteKBs(deltabyteswr / 1024); } } final VmStats newStat = new VmStats(); newStat.usedTime = info.cpuTime; newStat.rx = rx; newStat.tx = tx; newStat.ioRead = ioRd; newStat.ioWrote = ioWr; newStat.bytesRead = bytesRd; newStat.bytesWrote = bytesWr; newStat.timestamp = now; this.vmStats.put(vmName, newStat); return stats; } finally { if (dm != null) { dm.free(); } } }  @Override ExecutionResult executeInVR(final String routerIp, final String script, final String args); @Override ExecutionResult executeInVR(final String routerIp, final String script, final String args, final int timeout); @Override ExecutionResult createFileInVR(final String routerIp, final String path, final String filename,
                                          final String content); @Override ExecutionResult prepareCommand(final NetworkElementCommand cmd); @Override ExecutionResult cleanupCommand(final NetworkElementCommand cmd); List<InterfaceDef> getInterfaces(final Connect conn, final String vmName, final String interfaceToExclude); List<VifDriver> getAllVifDrivers(); List<InterfaceDef> getInterfaces(final Connect conn, final String vmName); String networkUsage(final String privateIpAddress, final String option, final String vif); Domain getDomain(final Connect conn, final String vmName); VifDriver getVifDriver(final TrafficType trafficType); boolean isInterface(final String fname); LibvirtUtilitiesHelper getLibvirtUtilitiesHelper(); CpuStat getCpuStat(); MemStat getMemStat(); VirtualRoutingResource getVirtRouterResource(); String getPublicBridgeName(); KvmStoragePoolManager getStoragePoolMgr(); String getPrivateIp(); int getMigrateDowntime(); int getMigratePauseAfter(); int getMigrateSpeed(); int getMigrateSpeedAcrossCluster(); int getVmBlockCopySpeed(); String getPingTestPath(); String getUpdateHostPasswdPath(); int getScriptsTimeout(); KvmHaMonitor getMonitor(); StorageLayer getStorage(); String createTmplPath(); int getCmdsTimeout(); String manageSnapshotPath(); String getGuestBridgeName(); String getOvsPvlanDhcpHostPath(); String getOvsPvlanVmPath(); StorageSubsystemCommandHandler getStorageHandler(); @Override boolean configure(final Map<String, Object> params); @Override void configure(final AgentConfiguration agentConfiguration); @Override Answer executeRequest(final Command cmd); @Override boolean stop(); boolean passCmdLine(final String vmName, final String cmdLine); boolean checkNetwork(final String networkName); KvmPhysicalDisk templateToPrimaryDownload(final String templateUrl, final KvmStoragePool primaryPool,
                                                     final String volUuid); PowerState getVmState(final Connect conn, final String vmName); long[] getNetworkStats(final String privateIp); long[] getVpcNetworkStats(final String privateIp, final String publicIp, final String option); String configureVpcNetworkUsage(final String privateIpAddress, final String publicIp, final String option,
                                           final String vpcCidr); void handleVmStartFailure(final LibvirtVmDef vm); String getCurrentLocalDateTimeStamp(); Long getCurrentEpoch(); LibvirtVmDef createVmFromSpec(final VirtualMachineTO vmTo); boolean isGuestVirtIoCapable(final String guestOsName); void createVifs(final VirtualMachineTO vmSpec, final LibvirtVmDef vm); String getVolumePath(final Connect conn, final DiskTO volume); @Override PingCommand getCurrentStatus(final long id); void createVbd(final Connect conn, final VirtualMachineTO vmSpec, final String vmName, final LibvirtVmDef vm); @Override HostType getType(); String diskUuidToSerial(final String uuid); @Override StartupCommand[] initialize(); synchronized String attachOrDetachIso(final Connect conn, final String vmName, String isoPath,
                                                 final boolean isAttach); List<LibvirtDiskDef> getDisks(final Connect conn, final String vmName); boolean cleanupDisk(final LibvirtDiskDef disk); String rebootVm(final Connect conn, final String vmName); String stopVm(final Connect conn, final String vmName, final boolean forceStop); String startVm(final Connect conn, final String vmName, final String domainXml); List<Ternary<String, Boolean, String>> cleanVMSnapshotMetadata(final Domain dm); void restoreVMSnapshotMetadata(final Domain dm, final String vmName, final List<Ternary<String, Boolean, String>> vmsnapshots); Integer getVncPort(final Connect conn, final String vmName); List<VmDiskStatsEntry> getVmDiskStat(final Connect conn, final String vmName); VmStatsEntry getVmStat(final Connect conn, final String vmName); Pair<Double, Double> getNicStats(final String nicName); @Override void setName(final String name); List<String> getCpuFeatures(); String getSystemTermpolicyCrash(); String getSystemTermpolicyPowerOff(); String getSystemTermpolicyReboot(); String getVmTermpolicyCrash(); String getVmTermpolicyPowerOff(); String getVmTermpolicyReboot(); String[] getIfNamePatterns(); long getTotalMemory(); }
LibvirtComputingResource extends AgentResourceBase implements AgentResource, VirtualRouterDeployer { public VmStatsEntry getVmStat(final Connect conn, final String vmName) throws LibvirtException { Domain dm = null; try { dm = getDomain(conn, vmName); final DomainInfo info = dm.getInfo(); final VmStatsEntry stats = new VmStatsEntry(); stats.setNumCPUs(info.nrVirtCpu); stats.setEntityType("vm"); VmStats oldStats = null; final Calendar now = Calendar.getInstance(); oldStats = this.vmStats.get(vmName); long elapsedTime = 0; if (oldStats != null) { elapsedTime = now.getTimeInMillis() - oldStats.timestamp.getTimeInMillis(); double utilization = (info.cpuTime - oldStats.usedTime) / ((double) elapsedTime * 1000000); final NodeInfo node = conn.nodeInfo(); utilization = utilization / node.cpus; if (utilization > 0) { stats.setCPUUtilization(utilization * 100); } } final List<InterfaceDef> vifs = getInterfaces(conn, vmName); long rx = 0; long tx = 0; for (final InterfaceDef vif : vifs) { final DomainInterfaceStats ifStats = dm.interfaceStats(vif.getDevName()); rx += ifStats.rx_bytes; tx += ifStats.tx_bytes; } if (oldStats != null) { final double deltarx = rx - oldStats.rx; if (deltarx > 0) { stats.setNetworkReadKBs(deltarx / 1024); } final double deltatx = tx - oldStats.tx; if (deltatx > 0) { stats.setNetworkWriteKBs(deltatx / 1024); } } final List<LibvirtDiskDef> disks = getDisks(conn, vmName); long ioRd = 0; long ioWr = 0; long bytesRd = 0; long bytesWr = 0; for (final LibvirtDiskDef disk : disks) { if (disk.getDeviceType() == DeviceType.CDROM || disk.getDeviceType() == DeviceType.FLOPPY) { continue; } final DomainBlockStats blockStats = dm.blockStats(disk.getDiskLabel()); ioRd += blockStats.rd_req; ioWr += blockStats.wr_req; bytesRd += blockStats.rd_bytes; bytesWr += blockStats.wr_bytes; } if (oldStats != null) { final long deltaiord = ioRd - oldStats.ioRead; if (deltaiord > 0) { stats.setDiskReadIOs(deltaiord); } final long deltaiowr = ioWr - oldStats.ioWrote; if (deltaiowr > 0) { stats.setDiskWriteIOs(deltaiowr); } final double deltabytesrd = bytesRd - oldStats.bytesRead; if (deltabytesrd > 0) { stats.setDiskReadKBs(deltabytesrd / 1024); } final double deltabyteswr = bytesWr - oldStats.bytesWrote; if (deltabyteswr > 0) { stats.setDiskWriteKBs(deltabyteswr / 1024); } } final VmStats newStat = new VmStats(); newStat.usedTime = info.cpuTime; newStat.rx = rx; newStat.tx = tx; newStat.ioRead = ioRd; newStat.ioWrote = ioWr; newStat.bytesRead = bytesRd; newStat.bytesWrote = bytesWr; newStat.timestamp = now; this.vmStats.put(vmName, newStat); return stats; } finally { if (dm != null) { dm.free(); } } }  @Override ExecutionResult executeInVR(final String routerIp, final String script, final String args); @Override ExecutionResult executeInVR(final String routerIp, final String script, final String args, final int timeout); @Override ExecutionResult createFileInVR(final String routerIp, final String path, final String filename,
                                          final String content); @Override ExecutionResult prepareCommand(final NetworkElementCommand cmd); @Override ExecutionResult cleanupCommand(final NetworkElementCommand cmd); List<InterfaceDef> getInterfaces(final Connect conn, final String vmName, final String interfaceToExclude); List<VifDriver> getAllVifDrivers(); List<InterfaceDef> getInterfaces(final Connect conn, final String vmName); String networkUsage(final String privateIpAddress, final String option, final String vif); Domain getDomain(final Connect conn, final String vmName); VifDriver getVifDriver(final TrafficType trafficType); boolean isInterface(final String fname); LibvirtUtilitiesHelper getLibvirtUtilitiesHelper(); CpuStat getCpuStat(); MemStat getMemStat(); VirtualRoutingResource getVirtRouterResource(); String getPublicBridgeName(); KvmStoragePoolManager getStoragePoolMgr(); String getPrivateIp(); int getMigrateDowntime(); int getMigratePauseAfter(); int getMigrateSpeed(); int getMigrateSpeedAcrossCluster(); int getVmBlockCopySpeed(); String getPingTestPath(); String getUpdateHostPasswdPath(); int getScriptsTimeout(); KvmHaMonitor getMonitor(); StorageLayer getStorage(); String createTmplPath(); int getCmdsTimeout(); String manageSnapshotPath(); String getGuestBridgeName(); String getOvsPvlanDhcpHostPath(); String getOvsPvlanVmPath(); StorageSubsystemCommandHandler getStorageHandler(); @Override boolean configure(final Map<String, Object> params); @Override void configure(final AgentConfiguration agentConfiguration); @Override Answer executeRequest(final Command cmd); @Override boolean stop(); boolean passCmdLine(final String vmName, final String cmdLine); boolean checkNetwork(final String networkName); KvmPhysicalDisk templateToPrimaryDownload(final String templateUrl, final KvmStoragePool primaryPool,
                                                     final String volUuid); PowerState getVmState(final Connect conn, final String vmName); long[] getNetworkStats(final String privateIp); long[] getVpcNetworkStats(final String privateIp, final String publicIp, final String option); String configureVpcNetworkUsage(final String privateIpAddress, final String publicIp, final String option,
                                           final String vpcCidr); void handleVmStartFailure(final LibvirtVmDef vm); String getCurrentLocalDateTimeStamp(); Long getCurrentEpoch(); LibvirtVmDef createVmFromSpec(final VirtualMachineTO vmTo); boolean isGuestVirtIoCapable(final String guestOsName); void createVifs(final VirtualMachineTO vmSpec, final LibvirtVmDef vm); String getVolumePath(final Connect conn, final DiskTO volume); @Override PingCommand getCurrentStatus(final long id); void createVbd(final Connect conn, final VirtualMachineTO vmSpec, final String vmName, final LibvirtVmDef vm); @Override HostType getType(); String diskUuidToSerial(final String uuid); @Override StartupCommand[] initialize(); synchronized String attachOrDetachIso(final Connect conn, final String vmName, String isoPath,
                                                 final boolean isAttach); List<LibvirtDiskDef> getDisks(final Connect conn, final String vmName); boolean cleanupDisk(final LibvirtDiskDef disk); String rebootVm(final Connect conn, final String vmName); String stopVm(final Connect conn, final String vmName, final boolean forceStop); String startVm(final Connect conn, final String vmName, final String domainXml); List<Ternary<String, Boolean, String>> cleanVMSnapshotMetadata(final Domain dm); void restoreVMSnapshotMetadata(final Domain dm, final String vmName, final List<Ternary<String, Boolean, String>> vmsnapshots); Integer getVncPort(final Connect conn, final String vmName); List<VmDiskStatsEntry> getVmDiskStat(final Connect conn, final String vmName); VmStatsEntry getVmStat(final Connect conn, final String vmName); Pair<Double, Double> getNicStats(final String nicName); @Override void setName(final String name); List<String> getCpuFeatures(); String getSystemTermpolicyCrash(); String getSystemTermpolicyPowerOff(); String getSystemTermpolicyReboot(); String getVmTermpolicyCrash(); String getVmTermpolicyPowerOff(); String getVmTermpolicyReboot(); String[] getIfNamePatterns(); long getTotalMemory(); static final String SSHKEYSPATH; static final String SSHPRVKEYPATH; static final String SSHPUBKEYPATH; static final String BASH_SCRIPT_PATH; }