On 26/06/2015 19:42, John D Groenveld wrote:
In message <[email protected]>, Graham Stephens writes:
Does anyone else here have problems trying to start a kvm due to vnics
not initializing properly? It seems to me that the more vnics you add,
the more likely the problem is to occur.

No.

What's your reproducable configuration?
What version OmniOS?
How many VMs and VNICs?
What's your KVM invocations?

John
[email protected]

Hi John.

I'm on 151014 2cac697.
There are a couple of other zones defined but not running at the time. The problem happens with just one zone running and the kvm inside.

In the zone:

show-link:

LINK        CLASS     MTU    STATE    BRIDGE     OVER
fw2z0       vnic      9000   up       --         ?
fwo0        vnic      1500   up       --         ?
fwl0        vnic      1500   down     --         ?
fwl1        vnic      1500   up       --         ?
fwl2        vnic      1500   down     --         ?
fwl3        vnic      1500   down     --         ?

fwo0 is attached to an rge0
fwl0-3 are attached to a four-port e1000g
fw2zo is attached to an etherstub.

show-addr:

ADDROBJ           TYPE     STATE        ADDR
lo0/v4            static   ok           127.0.0.1/8
fwl0/temp         static   inaccessible 10.0.0.1/24
lo0/v6            static   ok           ::1/128

kvm startup script:

#!/usr/bin/bash

# configuration
VNICW0=fwo0
VNICL1=fwl1
VNICL2=fwl2
VNICL3=fwl3
# Sample zvol path.
HDD=/dev/zvol/dsk/rpool/zones/eppifw01/kvm
CD=/root/OpenBSD_x64_57.iso
VNC=5
# Memory for the KVM instance, in Megabytes (2^20 bytes).
MEM=1024

macw0=`dladm show-vnic -po macaddress $VNICW0`
macl1=`dladm show-vnic -po macaddress $VNICL1`
macl2=`dladm show-vnic -po macaddress $VNICL2`
macl3=`dladm show-vnic -po macaddress $VNICL3`

/usr/bin/qemu-system-x86_64 \
-name "$(basename $CD)" \
-boot cd \
-enable-kvm \
-vnc 10.0.0.1:$VNC -k en-gb \
-smp 2 \
-m $MEM \
-no-hpet \
-localtime \
-drive file=$HDD,if=ide,index=0 \
-drive file=$CD,media=cdrom,if=ide,index=2  \
-net nic,vlan=0,name=net0,model=e1000,macaddr=$macw0 \
-net vnic,vlan=0,name=net0,ifname=$VNICW0 \
-net nic,vlan=1,name=net0,model=e1000,macaddr=$macl1 \
-net vnic,vlan=1,name=net0,ifname=$VNICL1 \
-net nic,vlan=2,name=net0,model=e1000,macaddr=$macl2 \
-net vnic,vlan=2,name=net0,ifname=$VNICL2 \
-net nic,vlan=3,name=net0,model=e1000,macaddr=$macl3 \
-net vnic,vlan=3,name=net0,ifname=$VNICL3 \
-vga std \
-daemonize

if [ $? -gt 0 ]; then
    echo "Failed to start VM"
fi

# UDP port for VNC connections to the KVM instance. 5900 is added in the command.
port=`expr 5900 + $VNC`
public_nic=$(dladm show-vnic|grep fwl0|awk '{print $2}')
public_ip=$(ifconfig fwl0|grep inet|awk '{print $2}')
#public_ip=$(ifconfig $public_nic|grep inet|awk '{print $2}')

echo "Started VM:"
echo "Public: ${public_ip}:${port}"

---

I took the macaddr part off the vnic description, because at the time it seemed to help reduce the issue - but no longer. The usual error message I get from one of the vnics is "failed to bind interface xxxx".

...and please don't assume I know what I'm doing - that's probably not the case. ;)
_______________________________________________
OmniOS-discuss mailing list
[email protected]
http://lists.omniti.com/mailman/listinfo/omnios-discuss

Reply via email to