Deployment failed when using 8021Q Vlan Network Driver

Hello
I’m having this same issue
with the difference that I’m using 8021Q Network Driver, LXC and OpenNebula 4.14.2. Is there any workaround in this case?

This is the log

Wed Jan 20 12:04:09 2016 [Z0][VM][I]: New state is ACTIVE
Wed Jan 20 12:04:10 2016 [Z0][VM][I]: New LCM state is PROLOG
Wed Jan 20 12:04:11 2016 [Z0][VM][I]: New LCM state is BOOT
Wed Jan 20 12:04:11 2016 [Z0][VMM][I]: Generating deployment file: /var/lib/one/vms/4/deployment.0
Wed Jan 20 12:04:12 2016 [Z0][VMM][I]: Command execution fail: /var/tmp/one/vnm/802.1Q/pre PFZNPjxJRD40PC9JRD48REVQTE9ZX0lELz48VEVNUExBVEU+PE5JQz48QVJfSUQ+PCFbQ0RBVEFbMF1dPjwvQVJfSUQ+PEJSSURHRT48IVtDREFUQVtvbmUxXV0+PC9CUklER0U+PElQPjwhW0NEQVRBWzEwLjguOTEuMjMwXV0+PC9JUD48TUFDPjwhW0NEQVRBWzAyOjAwOjBhOjA4OjViOmU2XV0+PC9NQUM+PE1UVT48IVtDREFUQVs0MDFdXT48L01UVT48TkVUV09SSz48IVtDREFUQVt2bGFuXV0+PC9ORVRXT1JLPjxORVRXT1JLX0lEPjwhW0NEQVRBWzBdXT48L05FVFdPUktfSUQ+PE5FVFdPUktfVU5BTUU+PCFbQ0RBVEFbb25lYWRtaW5dXT48L05FVFdPUktfVU5BTUU+PE5JQ19JRD48IVtDREFUQVswXV0+PC9OSUNfSUQ+PFBIWURFVj48IVtDREFUQVtldGgwXV0+PC9QSFlERVY+PFNFQ1VSSVRZX0dST1VQUz48IVtDREFUQVswXV0+PC9TRUNVUklUWV9HUk9VUFM+PFZMQU4+PCFbQ0RBVEFbWUVTXV0+PC9WTEFOPjxWTEFOX0lEPjwhW0NEQVRBWzQwMF1dPjwvVkxBTl9JRD48L05JQz48L1RFTVBMQVRFPjxURU1QTEFURT48U0VDVVJJVFlfR1JPVVBfUlVMRT48UFJPVE9DT0w+PCFbQ0RBVEFbQUxMXV0+PC9QUk9UT0NPTD48UlVMRV9UWVBFPjwhW0NEQVRBW09VVEJPVU5EXV0+PC9SVUxFX1RZUEU+PFNFQ1VSSVRZX0dST1VQX0lEPjwhW0NEQVRBWzBdXT48L1NFQ1VSSVRZX0dST1VQX0lEPjxTRUNVUklUWV9HUk9VUF9OQU1FPjwhW0NEQVRBW2RlZmF1bHRdXT48L1NFQ1VSSVRZX0dST1VQX05BTUU+PC9TRUNVUklUWV9HUk9VUF9SVUxFPjwvVEVNUExBVEU+PFRFTVBMQVRFPjxTRUNVUklUWV9HUk9VUF9SVUxFPjxQUk9UT0NPTD48IVtDREFUQVtBTExdXT48L1BST1RPQ09MPjxSVUxFX1RZUEU+PCFbQ0RBVEFbSU5CT1VORF1dPjwvUlVMRV9UWVBFPjxTRUNVUklUWV9HUk9VUF9JRD48IVtDREFUQVswXV0+PC9TRUNVUklUWV9HUk9VUF9JRD48U0VDVVJJVFlfR1JPVVBfTkFNRT48IVtDREFUQVtkZWZhdWx0XV0+PC9TRUNVUklUWV9HUk9VUF9OQU1FPjwvU0VDVVJJVFlfR1JPVVBfUlVMRT48L1RFTVBMQVRFPjxISVNUT1JZX1JFQ09SRFM+PEhJU1RPUlk+PEhPU1ROQU1FPjEwLjguOTEuODE8L0hPU1ROQU1FPjwvSElTVE9SWT48L0hJU1RPUllfUkVDT1JEUz48L1ZNPg==
Wed Jan 20 12:04:12 2016 [Z0][VMM][I]: /var/tmp/one/vnm/nic.rb:36:in new_nic': undefined methodnew’ for nil:NilClass (NoMethodError)
Wed Jan 20 12:04:12 2016 [Z0][VMM][I]: from /var/tmp/one/vnm/vm.rb:46:in block in initialize' Wed Jan 20 12:04:12 2016 [Z0][VMM][I]: from /usr/lib/ruby/2.1.0/rexml/element.rb:902:inblock in each’
Wed Jan 20 12:04:12 2016 [Z0][VMM][I]: from /usr/lib/ruby/2.1.0/rexml/xpath.rb:67:in each' Wed Jan 20 12:04:12 2016 [Z0][VMM][I]: from /usr/lib/ruby/2.1.0/rexml/xpath.rb:67:ineach’
Wed Jan 20 12:04:12 2016 [Z0][VMM][I]: from /usr/lib/ruby/2.1.0/rexml/element.rb:902:in each' Wed Jan 20 12:04:12 2016 [Z0][VMM][I]: from /var/tmp/one/vnm/vm.rb:45:ininitialize’
Wed Jan 20 12:04:12 2016 [Z0][VMM][I]: from /var/tmp/one/vnm/vnm_driver.rb:46:in new' Wed Jan 20 12:04:12 2016 [Z0][VMM][I]: from /var/tmp/one/vnm/vnm_driver.rb:46:ininitialize’
Wed Jan 20 12:04:12 2016 [Z0][VMM][I]: from /var/tmp/one/vnm/vlan.rb:29:in initialize' Wed Jan 20 12:04:12 2016 [Z0][VMM][I]: from /var/tmp/one/vnm/802.1Q/vlan_tag_driver.rb:38:ininitialize’
Wed Jan 20 12:04:12 2016 [Z0][VMM][I]: from /var/tmp/one/vnm/vnm_driver.rb:56:in new' Wed Jan 20 12:04:12 2016 [Z0][VMM][I]: from /var/tmp/one/vnm/vnm_driver.rb:56:infrom_base64’
Wed Jan 20 12:04:12 2016 [Z0][VMM][I]: from /var/tmp/one/vnm/802.1Q/pre:24:in `'
Wed Jan 20 12:04:12 2016 [Z0][VMM][I]: ExitCode: 1
Wed Jan 20 12:04:12 2016 [Z0][VMM][I]: Failed to execute network driver operation: pre.
Wed Jan 20 12:04:12 2016 [Z0][VMM][E]: Error deploying virtual machine
Wed Jan 20 12:04:12 2016 [Z0][VM][I]: New LCM state is BOOT_FAILURE

Thanks

I think I found a workaround.
In case anyone else encounters this issue, modify /var/lib/one/remotes/vnm/vnm_driver.rb . Find this:

    def detect_hypervisor
        lsmod       = `#{VNMNetwork::COMMANDS[:lsmod]}`
        xen_file    = "/proc/xen/capabilities"
        kvm_dir     = "/sys/class/misc/kvm"

        if File.exists?(xen_file)
            "xen"
        elsif lsmod.match(/kvm/) || File.exists?(kvm_dir)
            "kvm"
        else
            nil
        end
    end

and replace it with this

    def detect_hypervisor
        lsmod       = `#{VNMNetwork::COMMANDS[:lsmod]}`
        xen_file    = "/proc/xen/capabilities"
        kvm_dir     = "/sys/class/misc/kvm"

        if File.exists?(xen_file)
            "xen"
        else
            "kvm"
        end
    end

Here @ruben already explained why this happened. In this case, I’m using nested virtualization (node is a KVM virtual machine instead of a physical machine), this could be the reason why lsmod | grep kvm comes out empty.