Package org.rhq.plugins.virt.LibVirtConnection

Examples of org.rhq.plugins.virt.LibVirtConnection.HVInfo


        }
    }

    public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception {
        if (virt.isConnected()) {
            HVInfo hi = virt.getHVInfo();
            for (MeasurementScheduleRequest request : metrics) {
                if (request.getName().equals("cpus")) {
                    report.addData(new MeasurementDataTrait(request, "" + hi.nodeInfo.cpus));
                } else if (request.getName().equals("memory")) {
                    report.addData(new MeasurementDataTrait(request, "" + hi.nodeInfo.memory));
View Full Code Here


    }

    public Configuration loadResourceConfiguration() throws LibvirtException {
        Configuration config = new Configuration();
        if (virt.isConnected()) {
            HVInfo info = virt.getHVInfo();
            config.put(new PropertySimple("hypervisorType", info.hvType));
            config.put(new PropertySimple("hostName", info.hostname));
            config.put(new PropertySimple("libvirtVersion", getLibvirtVersion(info.libvirtVersion)));
        }
        return config;
View Full Code Here

        LibVirtConnection virt;
        try {
            String uri = config.getSimpleValue("connectionURI", "");
            //System.out.println(uri);
            virt = new LibVirtConnection(uri);
            HVInfo hi = virt.getHVInfo();
            res = new DiscoveredResourceDetails(type, "VirtHost." + hi.hostname, hi.hvType + " Hypervisor", ""
                + hi.version, String.format("Libvirt Connection to a %s hypervisor", hi.hvType), null, null);
            res.getPluginConfiguration().put(new PropertySimple("connectionURI", virt.getConnectionURI()));
            virt.close();
        } catch (Throwable t) {
View Full Code Here

TOP

Related Classes of org.rhq.plugins.virt.LibVirtConnection.HVInfo

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.