Command execution fail when attaching NIC or creating new VM with network support

Hi. I`ve successfully installed Opennebula, but have issues with attaching NIC to running VM or creating Vm with network.

Thu Oct 5 11:39:29 2017 [Z0][VM][I]: New LCM state is RUNNING
Thu Oct 5 11:40:50 2017 [Z0][VM][I]: New LCM state is HOTPLUG_NIC
Thu Oct 5 11:40:51 2017 [Z0][VMM][I]: ExitCode: 0
Thu Oct 5 11:40:51 2017 [Z0][VMM][I]: Successfully execute network driver operation: pre.
Thu Oct 5 11:40:51 2017 [Z0][VMM][I]: Command execution fail: cat << EOT | /var/tmp/one/vmm/kvm/attach_nic ‘one-9’ ‘02:00:0a:00:50:c8’ ‘ovs-br0’ ‘-’ ‘dummy’ ‘one-9-0’ 9 cont3ceph
Thu Oct 5 11:40:51 2017 [Z0][VMM][E]: attach_nic: Command “virsh --connect qemu:///system attach-device one-9 (
Thu Oct 5 11:40:51 2017 [Z0][VMM][I]: cat <Thu Oct 5 11:40:51 2017 [Z0][VMM][I]:
Thu Oct 5 11:40:51 2017 [Z0][VMM][I]: EOT
Thu Oct 5 11:40:51 2017 [Z0][VMM][I]: )” failed: bash: line 3: syntax error near unexpected token (' Thu Oct 5 11:40:51 2017 [Z0][VMM][I]: bash: line 3:virsh --connect qemu:///system attach-device one-9 ('
Thu Oct 5 11:40:51 2017 [Z0][VMM][E]: Could not attach NIC 0 (02:00:0a:00:50:c8) to one-9
Thu Oct 5 11:40:51 2017 [Z0][VMM][I]: ExitCode: 2
Thu Oct 5 11:40:51 2017 [Z0][VMM][I]: Failed to execute virtualization driver operation: attach_nic.
Thu Oct 5 11:40:51 2017 [Z0][VMM][E]: Error attaching new VM NIC: Could not attach NIC 0 (02:00:0a:00:50:c8) to one-9
Thu Oct 5 11:40:51 2017 [Z0][VM][I]: New LCM state is RUNNING

Here it is log from VM Creation

Thu Oct 5 15:41:58 2017 [Z0][VM][I]: New state is ACTIVE
Thu Oct 5 15:41:58 2017 [Z0][VM][I]: New LCM state is PROLOG
Thu Oct 5 15:42:00 2017 [Z0][VM][I]: New LCM state is BOOT
Thu Oct 5 15:42:00 2017 [Z0][VMM][I]: Generating deployment file: /var/lib/one/vms/12/deployment.0
Thu Oct 5 15:42:01 2017 [Z0][VMM][I]: Successfully execute transfer manager driver operation: tm_context.
Thu Oct 5 15:42:01 2017 [Z0][VMM][I]: ExitCode: 0
Thu Oct 5 15:42:01 2017 [Z0][VMM][I]: Successfully execute network driver operation: pre.
Thu Oct 5 15:42:01 2017 [Z0][VMM][I]: Command execution fail: cat << EOT | /var/tmp/one/vmm/kvm/deploy ‘/var/lib/one//datastores/103/12/deployment.0’ ‘cont3ceph’ 12 cont3ceph
Thu Oct 5 15:42:01 2017 [Z0][VMM][I]: error: Failed to create domain from /var/lib/one//datastores/103/12/deployment.0
Thu Oct 5 15:42:01 2017 [Z0][VMM][I]: error: Unable to add bridge ovs-br0 port one-12-0: Operation not supported
Thu Oct 5 15:42:01 2017 [Z0][VMM][E]: Could not create domain from /var/lib/one//datastores/103/12/deployment.0
Thu Oct 5 15:42:01 2017 [Z0][VMM][I]: ExitCode: 255
Thu Oct 5 15:42:01 2017 [Z0][VMM][I]: Failed to execute virtualization driver operation: deploy.
Thu Oct 5 15:42:01 2017 [Z0][VMM][E]: Error deploying virtual machine: Could not create domain from /var/lib/one//datastores/103/12/deployment.0
Thu Oct 5 15:42:02 2017 [Z0][VM][I]: New LCM state is BOOT_FAILURE

I guess i found the reason - It was my mistake. I created bridge using openvswitch, but network was defined like standard bridge. After changing Virtual Network type to ovswitch - everything is ok (i’m talking about creating and attaching NICs). Next step is to resolve connectivity problem.

Thanks for reporting back, it’s a good habit.

Everything works like a charm, including HA for VMs (with flag -u inside HOOK Host).
I`ve already stuck with one more problem according to HA, but i think i have to open new issue.