Hi all,
I tried adding a second NIC to a KVM guest, but it never shows up in the
guest. I noticed that the necessary parameters weren't in the
/zones/UUID/root/startvm script so I added them and rebooted the zone, at
which point I found that the startvm script is rewritten every time the
zone is booted. Obviously whatever makes that script doesn't understand
multiple NICs.
Is this a known bug? Is it fixed? I'm running a custom build
of joyent_20151204T225629Z and I'm sure I could build a newer one if I had
to. (I did "lose" the guest I was using to do the builds by accident).
Cheers,
Lloyd
Gory details of JSON and shell script follow.
[root@maro ~]# vmadm get 9281337f-d364-4026-b40a-f8d72bf7c535 | json nics
[
{
"interface": "net0",
"mac": "22:b0:99:3f:87:6d",
"vlan_id": 18,
"nic_tag": "desktop",
"gateway": "10.0.1.1",
"gateways": [
"10.0.1.1"
],
"netmask": "255.255.255.0",
"ip": "10.0.1.51",
"ips": [
"10.0.1.51/24"
],
"model": "virtio",
"primary": true
},
{
"interface": "net1",
"mac": "22:b0:99:3f:87:6e",
"vlan_id": 2048,
"nic_tag": "desktop",
"gateway": "10.128.0.1",
"gateways": [
"10.128.0.1"
],
"ips": [
"addrconf"
],
"allowed_ips": [
"10.128.0.0/24",
"2001:470:f05b:8000::/64"
],
"model": "virtio",
"dhcp_server": true,
"allow_dhcp_spoofing": true
}
]
[root@maro ~]# cat /zones/9281337f-d364-4026-b40a-f8d72bf7c535/root/startvm
#!/usr/bin/bash
exec >/tmp/vm.startvm.log 2>&1
set -o xtrace
if [[ -x /startvm.zone ]]; then
exec /smartdc/bin/qemu-exec /startvm.zone "-m" "2048" "-name"
"9281337f-d364-4026-b40a-f8d72bf7c535" "-uuid"
"9281337f-d364-4026-b40a-f8d72bf7c535" "-cpu" "qemu64" "-smp" "2" "-drive"
"file=/dev/zvol/rdsk/zones/9281337f-d364-4026-b40a-f8d72bf7c535-disk0,if=virtio,index=0,media=disk,boot=on"
"-boot" "order=cd" "-device"
"virtio-net-pci,mac=22:b0:99:3f:87:6d,tx=timer,x-txtimer=200000,x-txburst=128,vlan=0"
"-net"
"vnic,name=net0,vlan=0,ifname=net0,ip=10.0.1.51,netmask=255.255.255.0,gateway_ip=10.0.1.1,hostname=maas,dns_ip0=10.0.1.36,dns_ip1=10.0.1.9"
"-smbios" "type=1,manufacturer=Joyent,product=SmartDC
HVM,version=7.20151204T225629Z,serial=9281337f-d364-4026-b40a-f8d72bf7c535,uuid=9281337f-d364-4026-b40a-f8d72bf7c535,sku=001,family=Virtual
Machine" "-pidfile" "/tmp/vm.pid" "-vga" "std" "-chardev"
"socket,id=qmp,path=/tmp/vm.qmp,server,nowait" "-qmp" "chardev:qmp"
"-chardev" "socket,id=serial0,path=/tmp/vm.console,server,nowait" "-serial"
"chardev:serial0" "-chardev"
"socket,id=serial1,path=/tmp/vm.ttyb,server,nowait" "-serial"
"chardev:serial1" "-vnc" "unix:/tmp/vm.vnc,password" "-parallel" "none"
"-usb" "-usbdevice" "tablet" "-k" "en-us"
else
exec /smartdc/bin/qemu-exec /smartdc/bin/qemu-system-x86_64 "-m" "2048"
"-name" "9281337f-d364-4026-b40a-f8d72bf7c535" "-uuid"
"9281337f-d364-4026-b40a-f8d72bf7c535" "-cpu" "qemu64" "-smp" "2" "-drive"
"file=/dev/zvol/rdsk/zones/9281337f-d364-4026-b40a-f8d72bf7c535-disk0,if=virtio,index=0,media=disk,boot=on"
"-boot" "order=cd" "-device"
"virtio-net-pci,mac=22:b0:99:3f:87:6d,tx=timer,x-txtimer=200000,x-txburst=128,vlan=0"
"-net"
"vnic,name=net0,vlan=0,ifname=net0,ip=10.0.1.51,netmask=255.255.255.0,gateway_ip=10.0.1.1,hostname=maas,dns_ip0=10.0.1.36,dns_ip1=10.0.1.9"
"-smbios" "type=1,manufacturer=Joyent,product=SmartDC
HVM,version=7.20151204T225629Z,serial=9281337f-d364-4026-b40a-f8d72bf7c535,uuid=9281337f-d364-4026-b40a-f8d72bf7c535,sku=001,family=Virtual
Machine" "-pidfile" "/tmp/vm.pid" "-vga" "std" "-chardev"
"socket,id=qmp,path=/tmp/vm.qmp,server,nowait" "-qmp" "chardev:qmp"
"-chardev" "socket,id=serial0,path=/tmp/vm.console,server,nowait" "-serial"
"chardev:serial0" "-chardev"
"socket,id=serial1,path=/tmp/vm.ttyb,server,nowait" "-serial"
"chardev:serial1" "-vnc" "unix:/tmp/vm.vnc,password" "-parallel" "none"
"-usb" "-usbdevice" "tablet" "-k" "en-us"
fi
exit 1
[root@maro ~]# uname -a
SunOS maro 5.11 joyent_20151204T225629Z i86pc i386 i86pc
-------------------------------------------
smartos-discuss
Archives: https://www.listbox.com/member/archive/184463/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00
Modify Your Subscription:
https://www.listbox.com/member/?member_id=25769125&id_secret=25769125-7688e9fb
Powered by Listbox: http://www.listbox.com