Examples of InterfaceDef


Examples of com.cloud.hypervisor.kvm.resource.LibvirtVMDef.InterfaceDef

            if (cmd.getType() == PvlanSetupCommand.Type.DHCP) {
                Script script = new Script(_ovsPvlanDhcpHostPath, _timeout, s_logger);
                if (add) {
                    conn = LibvirtConnection.getConnectionByVmName(dhcpName);
                    List<InterfaceDef> ifaces = getInterfaces(conn, dhcpName);
                    InterfaceDef guestNic = ifaces.get(0);
                    script.add(opr, "-b", _guestBridgeName, "-p", primaryPvlan, "-i", isolatedPvlan, "-n", dhcpName, "-d", dhcpIp, "-m", dhcpMac, "-I",
                            guestNic.getDevName());
                } else {
                    script.add(opr, "-b", _guestBridgeName, "-p", primaryPvlan, "-i", isolatedPvlan, "-n", dhcpName, "-d", dhcpIp, "-m", dhcpMac);
                }
                result = script.execute();
                if (result != null) {
View Full Code Here

Examples of com.cloud.hypervisor.kvm.resource.LibvirtVMDef.InterfaceDef

        String routerName = cmd.getAccessDetail(NetworkElementCommand.ROUTER_NAME);

        try {
            conn = LibvirtConnection.getConnectionByVmName(routerName);
            List<InterfaceDef> pluggedNics = getInterfaces(conn, routerName);
            InterfaceDef routerNic = null;

            for (InterfaceDef pluggedNic : pluggedNics) {
                if (pluggedNic.getMacAddress().equalsIgnoreCase(nic.getMac())) {
                    routerNic = pluggedNic;
                    break;
View Full Code Here

Examples of com.cloud.hypervisor.kvm.resource.LibvirtVMDef.InterfaceDef

            return false;
        }
        String vif = null;
        List<InterfaceDef> intfs = getInterfaces(conn, vmName);
        if (intfs.size() > 0) {
            InterfaceDef intf = intfs.get(0);
            vif = intf.getDevName();
        }
        Script cmd = new Script(_securityGroupPath, _timeout, s_logger);
        cmd.add("destroy_network_rules_for_vm");
        cmd.add("--vmname", vmName);
        if (vif != null) {
View Full Code Here

Examples of com.cloud.hypervisor.kvm.resource.LibvirtVMDef.InterfaceDef

        List<InterfaceDef> intfs = getInterfaces(conn, vmName);
        if (intfs.size() == 0 || intfs.size() < nic.getDeviceId()) {
            return false;
        }

        InterfaceDef intf = intfs.get(nic.getDeviceId());
        String brname = intf.getBrName();
        String vif = intf.getDevName();

        Script cmd = new Script(_securityGroupPath, _timeout, s_logger);
        cmd.add("default_network_rules");
        cmd.add("--vmname", vmName);
        cmd.add("--vmid", vmId.toString());
View Full Code Here

Examples of com.cloud.hypervisor.kvm.resource.LibvirtVMDef.InterfaceDef

        List<InterfaceDef> intfs = getInterfaces(conn, vmName);
        if (intfs.size() < nic.getDeviceId()) {
            return false;
        }

        InterfaceDef intf = intfs.get(nic.getDeviceId());
        String brname = intf.getBrName();
        String vif = intf.getDevName();

        Script cmd = new Script(_securityGroupPath, _timeout, s_logger);
        cmd.add("post_default_network_rules");
        cmd.add("--vmname", vmName);
        cmd.add("--vmid", vmId.toString());
View Full Code Here

Examples of com.cloud.hypervisor.kvm.resource.LibvirtVMDef.InterfaceDef

      if (cmd.getType() == PvlanSetupCommand.Type.DHCP) {
        Script script = new Script(_ovsPvlanDhcpHostPath, _timeout, s_logger);
        if (add) {
          conn = LibvirtConnection.getConnectionByVmName(dhcpName);
          List<InterfaceDef> ifaces = getInterfaces(conn, dhcpName);
          InterfaceDef guestNic = ifaces.get(0);
          script.add(opr, "-b", _guestBridgeName,
            "-p", primaryPvlan, "-i", isolatedPvlan, "-n", dhcpName,
            "-d", dhcpIp, "-m", dhcpMac, "-I", guestNic.getDevName());
        } else {
          script.add(opr, "-b", _guestBridgeName,
            "-p", primaryPvlan, "-i", isolatedPvlan, "-n", dhcpName,
            "-d", dhcpIp, "-m", dhcpMac);
        }
View Full Code Here

Examples of com.cloud.hypervisor.kvm.resource.LibvirtVMDef.InterfaceDef

        }

        try {
            conn = LibvirtConnection.getConnectionByVmName(routerName);
            List<InterfaceDef> pluggedNics = getInterfaces(conn, routerName);
            InterfaceDef routerNic = null;

            for (InterfaceDef pluggedNic : pluggedNics) {
                if (pluggedNic.getMacAddress().equalsIgnoreCase(nic.getMac())) {
                    routerNic = pluggedNic;
                    break;
View Full Code Here

Examples of com.cloud.hypervisor.kvm.resource.LibvirtVMDef.InterfaceDef

            return false;
        }
        String vif = null;
        List<InterfaceDef> intfs = getInterfaces(conn, vmName);
        if (intfs.size() > 0) {
            InterfaceDef intf = intfs.get(0);
            vif = intf.getDevName();
        }
        Script cmd = new Script(_securityGroupPath, _timeout, s_logger);
        cmd.add("destroy_network_rules_for_vm");
        cmd.add("--vmname", vmName);
        if (vif != null) {
View Full Code Here

Examples of com.cloud.hypervisor.kvm.resource.LibvirtVMDef.InterfaceDef

        List<InterfaceDef> intfs = getInterfaces(conn, vmName);
        if (intfs.size() == 0 || intfs.size() < nic.getDeviceId()) {
            return false;
        }

        InterfaceDef intf = intfs.get(nic.getDeviceId());
        String brname = intf.getBrName();
        String vif = intf.getDevName();

        Script cmd = new Script(_securityGroupPath, _timeout, s_logger);
        cmd.add("default_network_rules");
        cmd.add("--vmname", vmName);
        cmd.add("--vmid", vmId.toString());
View Full Code Here

Examples of com.cloud.hypervisor.kvm.resource.LibvirtVMDef.InterfaceDef

        List<InterfaceDef> intfs = getInterfaces(conn, vmName);
        if (intfs.size() < nic.getDeviceId()) {
            return false;
        }

        InterfaceDef intf = intfs.get(nic.getDeviceId());
        String brname = intf.getBrName();
        String vif = intf.getDevName();

        Script cmd = new Script(_securityGroupPath, _timeout, s_logger);
        cmd.add("post_default_network_rules");
        cmd.add("--vmname", vmName);
        cmd.add("--vmid", vmId.toString());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.