[OmniOS-discuss] unable to add second nic on KVM

Willems Dirk Dirk.Willems at exitas.be
Fri Nov 25 12:49:33 UTC 2016


Hello,

First of all Thank you for this wonderful OS.

I'm using it for Home virtualization and have the same server also running on my Work for testing purpose and want to use it for Production servers by my clients.

But I've a small problem.
I'm trying to add a second nic to the KVM image but when I start the KVM I can't connect anymore over ssh or ping the global zone and have to kill the KVM process.

root at OmniosExitas:/root# pkg info entire
          Name: entire
       Summary: Incorporation to constrain core system packages to same build
   Description: This package constrains core system package versions to the same
                build and provides a minimal set of additional packages.
         State: Installed
     Publisher: omnios
       Version: 11
        Branch: 0.151020
Packaging Date:  2. November 2016 01:21:08
          Size: 1.75 kB
          FMRI: pkg://omnios/entire@11-0.151020:20161102T012108Z<mailto:pkg://omnios/entire@11-0.151020:20161102T012108Z>


my dladm output


root at OmniosExitas:/root# dladm show-link
LINK        CLASS     MTU    STATE    BRIDGE     OVER
igb0        phys      1500   up       --         --
igb1        phys      1500   up       --         --
aggr0       aggr      1500   up       --         igb0,igb1
VLJJ01      vnic      1500   up       --         aggr0
VLJJ02      vnic      1500   up       --         aggr0
VSwitchJJ0  etherstub 9000   up       --         --
VSJJ01      vnic      9000   up       --         VSwitchJJ0
VSJJ02      vnic      9000   up       --         VSwitchJJ0


my script what I use


#!/usr/bin/bash

NAME=JJ01
# configuration
VNIC1=VLJJ01
VNIC2=VSJJ01
# Sample zvol path.
HDD=/dev/zvol/rdsk/KVM_pool/JJ01
# NOTE: You can add more... (see NOTE2 below)
#HDD2=/dev/zvol/rdsk/data/vm-data-zvol
CD=/Downloads/oel6.8.iso
VNC=1
# Memory for the KVM instance, in Megabytes (2^20 bytes).
MEM=10240

mac1=`dladm show-vnic -po macaddress $VNIC1`
mac2=`dladm show-vnic -po macaddress $VNIC2`

/usr/bin/qemu-system-x86_64 \
        -name "$(basename $NAME)" \
        -boot cd \
        -enable-kvm \
        -vnc 0.0.0.0:$VNC \
        -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=$mac1 \
        -net vnic,vlan=0,name=net0,ifname=$VNIC1,macaddr=$mac1, \
        -net nic,vlan=0,name=net1,model=e1000,macaddr=$mac2 \
        -net vnic,vlan=0,name=net1,ifname=$VNIC2,macaddr=$mac2, \
        -vga std \
        -daemonize

# NOTE2: Add an additional -drive file=$HDD2,if=ide,index=X for a unique X
# in the big command-line above if you want another drive.  Repeat as needed.

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

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

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

I don't see any suspicious in the messages only following

/var/adm/messages

[cid:part2.353ACBB6.6DAD3CB6 at exitas.be]


Thanks in advance.

Kind Regards.

Dirk Willems


--
[cid:part3.D6CE8210.C4479A2D at exitas.be] <http://www.exitas.be/>


Dirk Willems
System Engineer



[cid:part5.6F22BB88.3617876A at exitas.be]

+32 (0)3 443 12 38 <tel:003234431238>

[cid:part7.7200D0A3.5DEB2526 at exitas.be]

dirk.willems at exitas.be <mailto:dirk.willems at exitas.be>

[cid:part9.7E20E0B9.94C6903E at exitas.be]

Veldkant 31 - 2550 Kontich <https://goo.gl/maps/2fuSkEZe3Lz>

[cid:part11.7E270D5C.AC2FAB09 at exitas.be]

www.exitas.be <http://www.exitas.be>


Disclaimer <http://exitas.be/legal/disclaimer/>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://omniosce.org/ml-archive/attachments/20161125/aa328c9f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ATT00001.png
Type: image/png
Size: 42899 bytes
Desc: ATT00001.png
URL: <https://omniosce.org/ml-archive/attachments/20161125/aa328c9f/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ATT00002.png
Type: image/png
Size: 8486 bytes
Desc: ATT00002.png
URL: <https://omniosce.org/ml-archive/attachments/20161125/aa328c9f/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ATT00003.png
Type: image/png
Size: 524 bytes
Desc: ATT00003.png
URL: <https://omniosce.org/ml-archive/attachments/20161125/aa328c9f/attachment-0008.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ATT00004.png
Type: image/png
Size: 791 bytes
Desc: ATT00004.png
URL: <https://omniosce.org/ml-archive/attachments/20161125/aa328c9f/attachment-0009.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ATT00005.png
Type: image/png
Size: 803 bytes
Desc: ATT00005.png
URL: <https://omniosce.org/ml-archive/attachments/20161125/aa328c9f/attachment-0010.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ATT00006.png
Type: image/png
Size: 796 bytes
Desc: ATT00006.png
URL: <https://omniosce.org/ml-archive/attachments/20161125/aa328c9f/attachment-0011.png>


More information about the OmniOS-discuss mailing list