This procedure
explains how to create ISO boot configuration with 3 traffic interfaces and 3
required interfaces (one is for XR management, and two are reserved).
-
Invokes the KVM
-
-smbios type=1,manufacturer="cisco",product="Cisco IOS XRv 9000",uuid=97fc351b-431d-4cf2-9c01-43c283faf2a3 \
Sets
Universally Unique Identifier (UUID) for the VM instance. The UUID is used as
part of licensing to identify VM instance.
-
Pass host
CPU flags into guest.
-
-drive file=/home/username/bnbMay13/workdir-username/disk1.raw,if=virtio,media=disk,index=1 \
-drive file=/home/username/bnbMay13/workdir-username/xrv9k-fullk9-x.iso.baked,media=cdrom,index=2 \
Empties
harddisk and boots ISO.
-
Creates
memory.
-
-smp cores=4,threads=1,sockets=1 \
Creates
four virtual CPUs and one socket.
-
Enables
hardware acceleration.
-
Emulates
VGA console when using serial ports for console access. This step is
recommended.
-
Sets the
real time clock (RTC).
-
-netdev tap,id=host1,ifname=usernameLx1,script=no,downscript=no \
-netdev tap,id=host2,ifname=usernameLx2,script=no,downscript=no \
-netdev tap,id=host3,ifname=usernameLx3,script=no,downscript=no \
-device virtio-net-pci,romfile=,netdev=host1,id=host1,mac=52:46:84:57:A0:DA \
-device virtio-net-pci,romfile=,netdev=host2,id=host2,mac=52:46:C4:F4:36:0F \
-device virtio-net-pci,romfile=,netdev=host3,id=host3,mac=52:46:A5:C0:D0:C5 \
Creates 3
NICs; the first is mapped to XR management interface, the second and third are
reserved.
-
-netdev tap,id=data1,ifname=usernameXr1,script=no,downscript=no \
-netdev tap,id=data2,ifname=usernameXr2,script=no,downscript=no \
-netdev tap,id=data3,ifname=usernameXr3,script=no,downscript=no \
-device e1000,romfile=,netdev=data1,id=data1,mac=52:46:87:18:62:DF \
-device e1000,romfile=,netdev=data2,id=data2,mac=52:46:32:02:90:6F \
-device e1000,romfile=,netdev=data3,id=data3,mac=52:46:34:93:52:1F \
The fourth
to eleventh NICs are mapped to traffic ports. A minimum of one traffic
interface is recommended.
-
-serial telnet:0.0.0.0:10621,nowait,server \
-serial telnet:0.0.0.0:14713,nowait,server \
-serial telnet:0.0.0.0:18090,nowait,server \
-serial telnet:0.0.0.0:17181,nowait,server \
Creates
four serial ports to access console. The first serial port is mapped to XR
console. See Console Mapping section for additional information. A minimum of
one serial port is recommended.
For information on configuring the serial console access, see
Configuring the Serial Console Access in KVM using QEMU
section.
-
Boot the
ISO only once.
Example:
/usr/bin/kvm \
-smbios type=1,manufacturer=\"cisco\",product=\"Cisco IOS XRv 9000\",uuid=73c8134e-2f51-40c1-a8d5-27687d717857 \
-cpu host \
-drive file=/root/gorajama/workdir-root/disk1.raw,if=virtio,format=raw,media=disk,index=1 \
-drive if=pflash,format=raw,readonly,file=OVMF_CODE.fd \
-drive if=pflash,format=raw,file=OVMF_VARS.fd \
-drive file=/root/gorajama/workdir-root/xrv9k-full-x-24.4.2.14I.iso.baked,media=cdrom,index=2 \
-m 20480 \
-smp cores=4,threads=1,sockets=1 \
-enable-kvm \
-daemonize \
-rtc base=utc \
-name IOS-XRv-9000:root \
-netdev tap,id=host1,ifname=rootLx1,script=no,downscript=no \
-netdev tap,id=host2,ifname=rootLx2,script=no,downscript=no \
-netdev tap,id=host3,ifname=rootLx3,script=no,downscript=no \
-device virtio-net-pci,romfile=,netdev=host1,id=host1,bus=pci.0,mac=52:46:28:2B:47:AC,csum=off,guest_csum=off \
-device virtio-net-pci,romfile=,netdev=host2,id=host2,bus=pci.0,mac=52:46:C2:A9:4B:D7,csum=off,guest_csum=off \
-device virtio-net-pci,romfile=,netdev=host3,id=host3,bus=pci.0,mac=52:46:B1:65:5B:40,csum=off,guest_csum=off \
-netdev tap,id=data1,ifname=rootXr1,script=no,downscript=no \
-netdev tap,id=data2,ifname=rootXr2,script=no,downscript=no \
-netdev tap,id=data3,ifname=rootXr3,script=no,downscript=no \
-device e1000,romfile=,netdev=data1,id=data1,bus=pci.0,mac=52:46:6D:DA:1D:EA \
-device e1000,romfile=,netdev=data2,id=data2,bus=pci.0,mac=52:46:73:D7:9E:53 \
-device e1000,romfile=,netdev=data3,id=data3,bus=pci.0,mac=52:46:77:F6:B5:03 \
-monitor telnet:0.0.0.0:16908,server,nowait \
-serial telnet:0.0.0.0:13775,nowait,server \
-serial telnet:0.0.0.0:13329,nowait,server \
-serial telnet:0.0.0.0:18865,nowait,server \
-serial telnet:0.0.0.0:14514,nowait,server \
-boot once=d
Note
|
The disk
labeled disk1.raw in the example above can be created with
qemu-img. The
qemu-img is an utility to convert the virtual hard disk
format. Instead of a raw disk format, qcow2 disk format can be used in above
example.
A
preinstalled qcow2 image can also be used; in that case the cdrom parameter is
removed.
|
|