1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 <topology xmlns="http://www.cisco.com/VIRL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="0.9" xsi:schemaLocation="http://www.cisco.com/VIRL https://raw.github.com/CiscoVIRL/schema/v0.9/virl.xsd">
4 <entry key="management_network" type="String">flat</entry>
6 <node name="tg1" type="SIMPLE" subtype="server" location="570,238" vmImage="$$VM_IMAGE$$">
8 <entry key="config" type="String">#cloud-config
10 - ln -s -t /etc/rc.d /etc/rc.local
12 manage_etc_hosts: true
13 nfs_server_scratch: $$NFS_SERVER_SCRATCH$$
14 nfs_server_common: $$NFS_SERVER_COMMON$$
17 - systemctl start getty@ttyS0.service
18 - systemctl start rc-local
19 - touch /tmp/before-sed
20 - sed -i 's/^\s*PasswordAuthentication\s\+no/PasswordAuthentication yes/' /etc/ssh/sshd_config
21 - echo "UseDNS no" >> /etc/ssh/sshd_config
22 - service ssh restart
23 - service sshd restart
26 - gecos: User configured by VIRL Configuration Engine 0.21.4
27 lock-passwd: false
29 plain-text-passwd: cisco
31 ssh-authorized-keys:
32 - VIRL-USER-SSH-PUBLIC-KEY
33 - VIRL-USER-SSH-PUBLIC-KEY
34 sudo: ALL=(ALL) NOPASSWD:ALL
36 - path: /etc/init/ttyS0.conf
40 # This service maintains a getty on ttyS0 from the point the system is
41 # started until it is shut down again.
42 start on stopped rc or RUNLEVEL=[12345]
43 stop on runlevel [!12345]
45 exec /sbin/getty -L 115200 ttyS0 vt102
46 permissions: '0644'
47 - path: /etc/systemd/system/dhclient@.service
50 Description=Run dhclient on %i interface
51 After=network.target
54 ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease
55 RemainAfterExit=yes
57 permissions: '0644'
58 - path: /usr/local/sbin/cloud-instance-name
62 print pickle.loads(open('/var/lib/cloud/instance/obj.pkl').read()).metadata['name']
65 - path: /etc/rc.local
67 permissions: '0755'
70 grep -q nfs_server_scratch /var/lib/cloud/instance/user-data.txt || exit 1
71 grep -q nfs_server_common /var/lib/cloud/instance/user-data.txt || exit 1
72 nfs_server_scratch=$(grep -E '^nfs_server_scratch:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }')
73 nfs_server_common=$(grep -E '^nfs_server_common:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }')
74 instance_name=$(/usr/local/sbin/cloud-instance-name | cut -f 3 -d '<' | cut -f 1 -d '>')
75 echo My instance name is $instance_name
83 echo "Mounting NFS directories"
85 while [ $count -lt $MAXCOUNT ] && ! mount -t nfs "${nfs_server_scratch}/${instance_name}" /scratch
91 mount -t nfs "${nfs_server_common}" /mnt/common
93 mkdir /scratch/$(hostname)
94 cp /VERSION /scratch/$(hostname)/
98 <entry key="Auto-generate config" type="Boolean">false</entry>
100 <interface id="0" name="eth1"/>
101 <interface id="1" name="eth2"/>
102 <interface id="2" name="eth3"/>
103 <interface id="3" name="eth4"/>
104 <interface id="4" name="eth5"/>
105 <interface id="5" name="eth6"/>
107 <node name="sut1" type="SIMPLE" subtype="vPP" location="425,26" vmImage="$$VM_IMAGE$$">
109 <entry key="config" type="string">#cloud-config
111 - ln -s -t /etc/rc.d /etc/rc.local
113 manage_etc_hosts: true
114 nfs_server_scratch: $$NFS_SERVER_SCRATCH$$
115 nfs_server_common: $$NFS_SERVER_COMMON$$
118 - systemctl start getty@ttyS0.service
119 - systemctl start rc-local
120 - sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config
121 - echo "UseDNS no" >> /etc/ssh/sshd_config
122 - service ssh restart
123 - service sshd restart
124 - sed -i 's/no-pci//' /opt/cisco/vpe/etc/qn.conf
125 - sed -i 's/1024/1024 decimal-interface-names/g' /opt/cisco/vpe/etc/qn.conf
128 - gecos: User configured by VIRL Configuration Engine 0.21.4
131 plain-text-passwd: cisco
134 - VIRL-USER-SSH-PUBLIC-KEY
135 - VIRL-USER-SSH-PUBLIC-KEY
136 sudo: ALL=(ALL) NOPASSWD:ALL
138 - path: /etc/init/ttyS0.conf
142 # This service maintains a getty on ttyS0 from the point the system is
143 # started until it is shut down again.
144 start on stopped rc or RUNLEVEL=[12345]
145 stop on runlevel [!12345]
147 exec /sbin/getty -L 115200 ttyS0 vt102
149 - path: /etc/systemd/system/dhclient@.service
152 Description=Run dhclient on %i interface
156 ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease
160 - path: /usr/local/sbin/cloud-instance-name
164 print pickle.loads(open('/var/lib/cloud/instance/obj.pkl').read()).metadata['name']
167 - path: /etc/rc.local
168 owner: root:root
169 permissions: '0755'
172 grep -q nfs_server_scratch /var/lib/cloud/instance/user-data.txt || exit 1
173 grep -q nfs_server_common /var/lib/cloud/instance/user-data.txt || exit 1
174 nfs_server_scratch=$(grep -E '^nfs_server_scratch:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }')
175 nfs_server_common=$(grep -E '^nfs_server_common:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }')
176 instance_name=$(/usr/local/sbin/cloud-instance-name | cut -f 3 -d '<' | cut -f 1 -d '>')
177 echo My instance name is $instance_name
185 echo "Mounting NFS directories"
187 while [ $count -lt $MAXCOUNT ] && ! mount -t nfs "${nfs_server_scratch}/${instance_name}" /scratch
193 mount -t nfs "${nfs_server_common}" /mnt/common
195 # Overwrite nested VM image with latest as per NFS
196 if [ -f /mnt/common/nested-vm-current.img ]
198 rm -f /var/lib/vm/vhost-nested.img
199 cp /mnt/common/nested-vm-current.img /var/lib/vm/vhost-nested.img
202 mkdir /scratch/$(hostname)
203 cp /VERSION /scratch/$(hostname)/
204 cat /var/lib/vm/vhost-nested.img | strings | grep NESTED_VERSION= > /scratch/$(hostname)/NESTED_VERSION
209 <interface id="0" name="GigabitEthernet0/4/0"/>
210 <interface id="1" name="GigabitEthernet0/5/0"/>
211 <interface id="2" name="GigabitEthernet0/6/0"/>
212 <interface id="3" name="GigabitEthernet0/7/0"/>
214 <node name="sut2" type="SIMPLE" subtype="vPP" location="748,26" vmImage="$$VM_IMAGE$$">
216 <entry key="config" type="string">#cloud-config
218 - ln -s -t /etc/rc.d /etc/rc.local
220 manage_etc_hosts: true
221 nfs_server_scratch: $$NFS_SERVER_SCRATCH$$
222 nfs_server_common: $$NFS_SERVER_COMMON$$
225 - systemctl start getty@ttyS0.service
226 - systemctl start rc-local
227 - sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config
228 - echo "UseDNS no" >> /etc/ssh/sshd_config
229 - service ssh restart
230 - service sshd restart
231 - sed -i 's/no-pci//' /opt/cisco/vpe/etc/qn.conf
232 - sed -i 's/1024/1024 decimal-interface-names/g' /opt/cisco/vpe/etc/qn.conf
235 - gecos: User configured by VIRL Configuration Engine 0.21.4
238 plain-text-passwd: cisco
241 - VIRL-USER-SSH-PUBLIC-KEY
242 - VIRL-USER-SSH-PUBLIC-KEY
243 sudo: ALL=(ALL) NOPASSWD:ALL
245 - path: /etc/init/ttyS0.conf
249 # This service maintains a getty on ttyS0 from the point the system is
250 # started until it is shut down again.
251 start on stopped rc or RUNLEVEL=[12345]
252 stop on runlevel [!12345]
254 exec /sbin/getty -L 115200 ttyS0 vt102
256 - path: /etc/systemd/system/dhclient@.service
259 Description=Run dhclient on %i interface
263 ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease
267 - path: /usr/local/sbin/cloud-instance-name
271 print pickle.loads(open('/var/lib/cloud/instance/obj.pkl').read()).metadata['name']
274 - path: /etc/rc.local
275 owner: root:root
276 permissions: '0755'
279 grep -q nfs_server_scratch /var/lib/cloud/instance/user-data.txt || exit 1
280 grep -q nfs_server_common /var/lib/cloud/instance/user-data.txt || exit 1
281 nfs_server_scratch=$(grep -E '^nfs_server_scratch:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }')
282 nfs_server_common=$(grep -E '^nfs_server_common:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }')
283 instance_name=$(/usr/local/sbin/cloud-instance-name | cut -f 3 -d '<' | cut -f 1 -d '>')
284 echo My instance name is $instance_name
292 echo "Mounting NFS directories"
294 while [ $count -lt $MAXCOUNT ] && ! mount -t nfs "${nfs_server_scratch}/${instance_name}" /scratch
300 mount -t nfs "${nfs_server_common}" /mnt/common
302 # Overwrite nested VM image with latest as per NFS
303 if [ -f /mnt/common/nested-vm-current.img ]
305 rm -f /var/lib/vm/vhost-nested.img
306 cp /mnt/common/nested-vm-current.img /var/lib/vm/vhost-nested.img
309 mkdir /scratch/$(hostname)
310 cp /VERSION /scratch/$(hostname)/
311 cat /var/lib/vm/vhost-nested.img | strings | grep NESTED_VERSION= > /scratch/$(hostname)/NESTED_VERSION
316 <interface id="0" name="GigabitEthernet0/4/0"/>
317 <interface id="1" name="GigabitEthernet0/5/0"/>
318 <interface id="2" name="GigabitEthernet0/6/0"/>
319 <interface id="3" name="GigabitEthernet0/7/0"/>
321 <connection dst="/virl:topology/virl:node[1]/virl:interface[3]" src="/virl:topology/virl:node[2]/virl:interface[1]"/>
322 <connection dst="/virl:topology/virl:node[1]/virl:interface[4]" src="/virl:topology/virl:node[2]/virl:interface[2]"/>
323 <connection dst="/virl:topology/virl:node[2]/virl:interface[3]" src="/virl:topology/virl:node[3]/virl:interface[3]"/>
324 <connection dst="/virl:topology/virl:node[2]/virl:interface[4]" src="/virl:topology/virl:node[3]/virl:interface[4]"/>
325 <connection dst="/virl:topology/virl:node[1]/virl:interface[5]" src="/virl:topology/virl:node[3]/virl:interface[1]"/>
326 <connection dst="/virl:topology/virl:node[1]/virl:interface[6]" src="/virl:topology/virl:node[3]/virl:interface[2]"/>