Package com.cloud.agent.api

Examples of com.cloud.agent.api.HostVmStateReportEntry


   
    protected HashMap<String, HostVmStateReportEntry> getHostVmStateReport() {
      HashMap<String, HostVmStateReportEntry> report = new HashMap<String, HostVmStateReportEntry>();
     
      for(String vmName : _runningVms.keySet()) {
        report.put(vmName, new HostVmStateReportEntry(PowerState.PowerOn, agentHost.getName(), null));
      }
     
     
     
      return report;
View Full Code Here


                } catch (XmlRpcException e) {
                    s_logger.error("Failed to get host uuid for host " + host.toWireString(), e);
                }
                vmStates.put(
                  record.nameLabel,
                  new HostVmStateReportEntry(convertPowerState(ps), host_uuid, xstoolsversion)
                );
            }
        }

        return vmStates;
View Full Code Here

    protected HashMap<String, HostVmStateReportEntry> getHostVmStateReport() throws XmlRpcException {
        final HashMap<String, HostVmStateReportEntry> vmStates = new HashMap<String, HostVmStateReportEntry>();
        Map<String, String> vms = OvmHost.getAllVms(_conn);
        for (final Map.Entry<String, String> entry : vms.entrySet()) {
            PowerState state = toPowerState(entry.getKey(), entry.getValue());
            vmStates.put(entry.getKey(), new HostVmStateReportEntry(state, _conn.getIp(), null));
        }
        return vmStates;
    }
View Full Code Here

                final PowerState state = convertToPowerState(ps);

                s_logger.trace("VM " + dm.getName() + ": powerstate = " + ps
                        + "; vm state=" + state.toString());
                String vmName = dm.getName();
                vmStates.put(vmName, new HostVmStateReportEntry(state, conn.getHostName(), null));
            } catch (final LibvirtException e) {
                s_logger.warn("Unable to get vms", e);
            } finally {
                try {
                    if (dm != null) {
                        dm.free();
                    }
                } catch (LibvirtException e) {
                    s_logger.trace("Ignoring libvirt error.", e);
                }
            }
        }

        for (int i = 0; i < vms.length; i++) {
            try {

                dm = conn.domainLookupByName(vms[i]);

                DomainInfo.DomainState ps = dm.getInfo().state;
                final PowerState state = convertToPowerState(ps);
                String vmName = dm.getName();
                s_logger.trace("VM " + vmName + ": powerstate = " + ps
                        + "; vm state=" + state.toString());

                vmStates.put(vmName, new HostVmStateReportEntry(state, conn.getHostName(), null));
            } catch (final LibvirtException e) {
                s_logger.warn("Unable to get vms", e);
            } finally {
                try {
                    if (dm != null) {
View Full Code Here

TOP

Related Classes of com.cloud.agent.api.HostVmStateReportEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.