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=97fc351b-431d-4cf2-9c01-43c283faf2a3 \
-cpu host \
-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 \
-m 16384 \
-smp cores=4,threads=1,sockets=1 \
-enable-kvm \
-daemonize \
-display none \
-rtc base=utc \
-name IOS-XRv-9000:username \
-runas username \
-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 \
-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 \
-monitor telnet:0.0.0.0:11063,server,nowait \
-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 \
-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.
|
|