The CSR1000V-Router has already been prepared (Create a CSR1000V-Instance with nested Virtualiation support) and in (Part 4: Package the Service-VM into an OVA) we copied the OVA-Image of our „ubuntu-server“-VM to this Router.
Add the internal Network-Interface between Router and Service-VM
SERVICECONTAINER#conf t Enter configuration commands, one per line. End with CNTL/Z. SERVICECONTAINER(config)#int virtualportgroup 0 *Feb 3 19:05:17.206: %LINEPROTO-5-UPDOWN: Line protocol on Interface VirtualPortGroup0, changed state to up SERVICECONTAINER(config-if)#ip addr 192.168.0.1 255.255.255.0 SERVICECONTAINER(config-if)#exit SERVICECONTAINER(config)#virtual-service SERVICECONTAINER(config-virt-serv-global)#signing level unsigned % Support for unsigned packages has been user-enabled. Unsigned packages are not endorsed by Cisco Systems, Inc. User assumes all responsibility SERVICECONTAINER(config-virt-serv-global)#ex SERVICECONTAINER(config)#ip dhcp pool SERVICE SERVICECONTAINER(dhcp-config)# network 192.168.0.0 255.255.255.0 SERVICECONTAINER(dhcp-config)# exit SERVICECONTAINER(config)#virtual-service UBUNTU SERVICECONTAINER(config-virt-serv)#vnic gateway virtualPortGroup 0 SERVICECONTAINER(config-virt-serv-vnic)#guest ip address 192.168.0.2 SERVICECONTAINER(config-virt-serv-vnic)#end SERVICECONTAINER# *Feb 3 19:06:27.474: %SYS-5-CONFIG_I: Configured from console by console
Install the Service-VM
SERVICECONTAINER#debug virtual-service all virtual service all debugging is on SERVICECONTAINER#term mon % Console already monitors SERVICECONTAINER#term width 0
SERVICECONTAINER#virtual-service install name UBUNTU package bootflash:ubuntu1604.ova Installing package 'bootflash:/ubuntu1604.ova' for virtual-service 'UBUNTU'. Once the install has finished, the VM may be activated. Use 'show virtual-service list' for progress. *Feb 3 19:07:43.518: VIRTUAL-SERVICE [UBUNTU]: Sending install req for [UBUNTU], path=bootflash:/ubuntu1604.ova, uri= uid=0 *Feb 3 19:07:43.529: VIRTUAL-INSTANCE: Message sent for INSTALL TDL request: Virtual-instance name: UBUNTU, UID: 0 *Feb 3 19:07:43.529: VIRTUAL-SERVICE: Started response timer for tid DD000001 - 30 minutes *Feb 3 19:05:14.205: %IOSXE-4-PLATFORM: R0/0: kernel: dev->name [intsvc0]: dev_entry not populated SERVICECONTAINER#show virtual-service list System busy installing virtual-service 'UBUNTU'. The request may take several minutes... Virtual Service List: Name Status Package Name ------------------------------------------------------------------------------ UBUNTU Installing ubuntu1604.ova *Feb 3 19:08:00.645: %VMAN-5-PACKAGE_SIGNING_LEVEL_ON_INSTALL: R0/0: vman: Package 'ubuntu1604.ova' for service container 'UBUNTU' is 'unsigned', signing level cached on original install is 'unsigned' *Feb 3 19:08:09.216: VIRTUAL-SERVICE: Install response handler: VM[UBUNTU]: Owner IOSd trans_id 3707764737 *Feb 3 19:08:09.216: VIRTUAL-SERVICE [UBUNTU]: vm[UBUNTU] set owner [IOSd] *Feb 3 19:08:09.225: VIRTUAL-SERVICE [UBUNTU]: application_name: 'ubuntu' application_vendor: '' application_version: '1.1' *Feb 3 19:08:09.226: VIRTUAL-SERVICE [UBUNTU]: Default profile info: license_name: '', license_ver: '' *Feb 3 19:08:09.226: VIRTUAL-SERVICE: Install pkg response for tid DD000001: rc=0, descr=Install Success *Feb 3 19:08:09.226: VIRTUAL-SERVICE [UBUNTU]: License type: none, no license needed *Feb 3 19:08:09.226: %VIRT_SERVICE-5-INSTALL_STATE: Successfully installed virtual service UBUNTU *Feb 3 19:08:09.243: VIRTUAL-SERVICE: Received local transport activation request *Feb 3 19:08:09.244: VIRTUAL-SERVICE: Enabling vman local transport SERVICECONTAINER#show virtual-service list Virtual Service List: Name Status Package Name ------------------------------------------------------------------------------ UBUNTU Installed ubuntu1604.ova *Feb 3 19:08:32.758: %ONEP_BASE-6-SS_ENABLED: ONEP: Service set Base was enabled by Default *Feb 3 19:08:33.259: VIRTUAL-SERVICE: Local transport 'activation' request processed
Activate the installed Service-VM
SERVICECONTAINER#conf t Enter configuration commands, one per line. End with CNTL/Z. SERVICECONTAINER(config)#virtual-service UBUNTU SERVICECONTAINER(config-virt-serv)#activate SERVICECONTAINER(config-virt-serv)#end % Activating virtual-service 'UBUNTU', this might take a few minutes. Use 'show virtual-service list' for progress. *Feb 3 19:09:57.772: VIRTUAL-SERVICE [UBUNTU]: Activate CLI: appl->owner [IOSd] *Feb 3 19:09:57.775: VIRTUAL-INSTANCE: Message sent for ACTIVATE TDL request: Virtual service name: UBUNTU, UID: 0 *Feb 3 19:09:57.775: VIRTUAL-SERVICE [UBUNTU]: Started virtual service (0) activate response timer - 30 minutes *Feb 3 19:10:06.052: %SYS-5-CONFIG_I: Configured from console by console *Feb 3 19:10:06.383: VIRTUAL-SERVICE [UBUNTU]: Activate response handler: got owner [IOSd] *Feb 3 19:10:06.383: VIRTUAL-SERVICE: clnt_type 0: Interface counter is '1' *Feb 3 19:10:06.383: VIRTUAL-SERVICE: Information for virtual port grp '0' is received *Feb 3 19:10:06.384: VIRTUAL-SERVICE [UBUNTU]: Deliver intf response, vm =UBUNTU, counter=1 *Feb 3 19:10:06.384: VIRTUAL-SERVICE [UBUNTU]: Received interface id=0, type=1, state=1 *Feb 3 19:10:06.384: VIRTUAL-SERVICE [UBUNTU]: Received virtual port group interface 0 with service MAC 001e.e5b1.cfba, state: up *Feb 3 19:10:06.385: VIRTUAL-INSTANCE: Message sent for IF MTU TDL message: appliance 'UBUNTU' *Feb 3 19:10:06.385: VIRTUAL-SERVICE [UBUNTU]: Activate response handler: rsp_rc 0 *Feb 3 19:10:06.385: VIRTUAL-SERVICE [UBUNTU]: Deliver response: appliance_state 3 rsp_rc 0 if_notify name UBUNTU clnt_type 0 act_state 0 *Feb 3 19:10:06.385: %VIRT_SERVICE-5-ACTIVATION_STATE: Successfully activated virtual service UBUNTUconf t *Feb 3 19:10:06.385: VIRTUAL-SERVICE [UBUNTU]: Stopped virtual service (1) response timer *Feb 3 19:10:06.385: VIRTUAL-SERVICE: Delivered Virt-manager response message to virtual service 'UBUNTU' - Response: 'OK' *Feb 3 19:10:06.385: VIRTUAL-SERVICE [UBUNTU]: set owner to 'IOSd' in appliance SERVICECONTAINER#show virtual-service list Virtual Service List: Name Status Package Name ------------------------------------------------------------------------------ UBUNTU Activated ubuntu1604.ova SERVICECONTAINER#show ip dhcp bind Bindings from all pools not associated with VRF: IP address Client-ID/ Lease expiration Type State Interface Hardware address/ User name 192.168.0.2 001e.e5b1.cfba Feb 04 2018 07:20 PM Automatic Active VirtualPortGroup0
Access the VM using the (virtual) Serial-Console
SERVICECONTAINER#virtual-service connect name UBUNTU console Connected to appliance. Exit using ^c^c^c Ubuntu 16.04.3 LTS ubuntu-server ttyS0 ubuntu-server login: user Password: Last login: Sat Feb 3 20:23:27 CET 2018 on ttyS0 Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-87-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage 9 packages can be updated. 7 updates are security updates. user@ubuntu-server:~$ who user ttyS0 2018-02-03 23:12
Logout: 3x [CTRL]+
user@ubuntu-server:~$ ^C user@ubuntu-server:~$ ^C user@ubuntu-server:~$ ^C
Access the VM using SSH via the internal Network
SERVICECONTAINER#ssh -l user 192.168.0.2 Password: Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-87-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage 9 packages can be updated. 7 updates are security updates. Last login: Sat Feb 3 23:12:21 2018 user@ubuntu-server:~$ who user pts/0 2018-02-03 23:13 (192.168.0.1)
Check the local python/NAPALM-Setup to get facts about the containing router
user@ubuntu-server:~$ python Python 2.7.12 (default, Dec 4 2017, 14:50:18) [GCC 5.4.0 20160609] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import napalm >>> iosdriver = napalm.get_network_driver('ios') dpass', optional_args={'port': 22, 'dest_file_system': 'bootflash:'})sword='rmon >>> router.open() >>> print router.get_facts() {u'os_version': u'Virtual XE Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 16.7.1, RELEASE SOFTWARE (fc6)', u'uptime': 12840, u'interface_list': [u'GigabitEthernet1', u'GigabitEthernet2', u'GigabitEthernet3', u'VirtualPortGroup0'], u'vendor': u'Cisco', u'serial_number': u'9SNHUBYAML', u'model': u'CSR1000V', u'hostname': u'SERVICECONTAINER', u'fqdn': u'SERVICECONTAINER.lab.local'}