From 909f20348b5aac1207678d1c0af8bbfa50f716c6 Mon Sep 17 00:00:00 2001 From: pmikus Date: Fri, 7 Oct 2016 13:00:53 +0100 Subject: Update VIRL images to 16.04.1 Change-Id: I93e8b5e977e974cda9ea4ebab327b59f9afd2fd0 Signed-off-by: pmikus --- .../virl/topologies/double-ring-nested.trusty.virl | 327 +++++++++++++++++++ .../virl/topologies/double-ring-nested.trusty.yaml | 95 ++++++ .../tools/virl/topologies/double-ring-nested.virl | 327 ------------------- .../virl/topologies/double-ring-nested.xenial.virl | 362 +++++++++++++++++++++ .../virl/topologies/double-ring-nested.xenial.yaml | 95 ++++++ .../tools/virl/topologies/double-ring-nested.yaml | 95 ------ 6 files changed, 879 insertions(+), 422 deletions(-) create mode 100644 resources/tools/virl/topologies/double-ring-nested.trusty.virl create mode 100644 resources/tools/virl/topologies/double-ring-nested.trusty.yaml delete mode 100644 resources/tools/virl/topologies/double-ring-nested.virl create mode 100644 resources/tools/virl/topologies/double-ring-nested.xenial.virl create mode 100644 resources/tools/virl/topologies/double-ring-nested.xenial.yaml delete mode 100644 resources/tools/virl/topologies/double-ring-nested.yaml (limited to 'resources/tools/virl') diff --git a/resources/tools/virl/topologies/double-ring-nested.trusty.virl b/resources/tools/virl/topologies/double-ring-nested.trusty.virl new file mode 100644 index 0000000000..4dd5885281 --- /dev/null +++ b/resources/tools/virl/topologies/double-ring-nested.trusty.virl @@ -0,0 +1,327 @@ + + + + flat + + + + #cloud-config +bootcmd: +- ln -s -t /etc/rc.d /etc/rc.local +hostname: tg1 +manage_etc_hosts: true +nfs_server_scratch: $$NFS_SERVER_SCRATCH$$ +nfs_server_common: $$NFS_SERVER_COMMON$$ +runcmd: +- start ttyS0 +- systemctl start getty@ttyS0.service +- systemctl start rc-local +- touch /tmp/before-sed +- sed -i 's/^\s*PasswordAuthentication\s\+no/PasswordAuthentication yes/' /etc/ssh/sshd_config +- echo "UseDNS no" >> /etc/ssh/sshd_config +- service ssh restart +- service sshd restart +users: +- default +- gecos: User configured by VIRL Configuration Engine 0.21.4 + lock-passwd: false + name: cisco + plain-text-passwd: cisco + shell: /bin/bash + ssh-authorized-keys: + - VIRL-USER-SSH-PUBLIC-KEY + - VIRL-USER-SSH-PUBLIC-KEY + sudo: ALL=(ALL) NOPASSWD:ALL +write_files: +- path: /etc/init/ttyS0.conf + owner: root:root + content: | + # ttyS0 - getty + # This service maintains a getty on ttyS0 from the point the system is + # started until it is shut down again. + start on stopped rc or RUNLEVEL=[12345] + stop on runlevel [!12345] + respawn + exec /sbin/getty -L 115200 ttyS0 vt102 + permissions: '0644' +- path: /etc/systemd/system/dhclient@.service + content: | + [Unit] + Description=Run dhclient on %i interface + After=network.target + [Service] + Type=oneshot + ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease + RemainAfterExit=yes + owner: root:root + permissions: '0644' +- path: /usr/local/sbin/cloud-instance-name + content: | + #!/usr/bin/python + import pickle + print pickle.loads(open('/var/lib/cloud/instance/obj.pkl').read()).metadata['name'] + owner: root:root + permissions: '0755' +- path: /etc/rc.local + owner: root:root + permissions: '0755' + content: |- + #!/bin/sh + grep -q nfs_server_scratch /var/lib/cloud/instance/user-data.txt || exit 1 + grep -q nfs_server_common /var/lib/cloud/instance/user-data.txt || exit 1 + nfs_server_scratch=$(grep -E '^nfs_server_scratch:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }') + nfs_server_common=$(grep -E '^nfs_server_common:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }') + instance_name=$(/usr/local/sbin/cloud-instance-name | cut -f 3 -d '<' | cut -f 1 -d '>') + echo My instance name is $instance_name + + MAXCOUNT=12 + RETRY=5 + + mkdir -p /scratch + mkdir -p /mnt/common + + echo "Mounting NFS directories" + count=0 + while [ $count -lt $MAXCOUNT ] && ! mount -t nfs "${nfs_server_scratch}/${instance_name}" /scratch + do + sleep 5 + count=$[$count+1] + done + + mount -t nfs "${nfs_server_common}" /mnt/common + + mkdir /scratch/$(hostname) + cp /VERSION /scratch/$(hostname)/ + + exit 0 + + false + + + + + + + + + + + #cloud-config +bootcmd: +- ln -s -t /etc/rc.d /etc/rc.local +hostname: sut1 +manage_etc_hosts: true +nfs_server_scratch: $$NFS_SERVER_SCRATCH$$ +nfs_server_common: $$NFS_SERVER_COMMON$$ +runcmd: +- start ttyS0 +- systemctl start getty@ttyS0.service +- systemctl start rc-local +- sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config +- echo "UseDNS no" >> /etc/ssh/sshd_config +- service ssh restart +- service sshd restart +- sed -i 's/no-pci//' /opt/cisco/vpe/etc/qn.conf +- sed -i 's/1024/1024 decimal-interface-names/g' /opt/cisco/vpe/etc/qn.conf +users: +- default +- gecos: User configured by VIRL Configuration Engine 0.21.4 + lock-passwd: false + name: cisco + plain-text-passwd: cisco + shell: /bin/bash + ssh-authorized-keys: + - VIRL-USER-SSH-PUBLIC-KEY + - VIRL-USER-SSH-PUBLIC-KEY + sudo: ALL=(ALL) NOPASSWD:ALL +write_files: +- path: /etc/init/ttyS0.conf + owner: root:root + content: | + # ttyS0 - getty + # This service maintains a getty on ttyS0 from the point the system is + # started until it is shut down again. + start on stopped rc or RUNLEVEL=[12345] + stop on runlevel [!12345] + respawn + exec /sbin/getty -L 115200 ttyS0 vt102 + permissions: '0644' +- path: /etc/systemd/system/dhclient@.service + content: | + [Unit] + Description=Run dhclient on %i interface + After=network.target + [Service] + Type=oneshot + ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease + RemainAfterExit=yes + owner: root:root + permissions: '0644' +- path: /usr/local/sbin/cloud-instance-name + content: | + #!/usr/bin/python + import pickle + print pickle.loads(open('/var/lib/cloud/instance/obj.pkl').read()).metadata['name'] + owner: root:root + permissions: '0755' +- path: /etc/rc.local + owner: root:root + permissions: '0755' + content: |- + #!/bin/sh + grep -q nfs_server_scratch /var/lib/cloud/instance/user-data.txt || exit 1 + grep -q nfs_server_common /var/lib/cloud/instance/user-data.txt || exit 1 + nfs_server_scratch=$(grep -E '^nfs_server_scratch:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }') + nfs_server_common=$(grep -E '^nfs_server_common:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }') + instance_name=$(/usr/local/sbin/cloud-instance-name | cut -f 3 -d '<' | cut -f 1 -d '>') + echo My instance name is $instance_name + + MAXCOUNT=12 + RETRY=5 + + mkdir -p /scratch + mkdir -p /mnt/common + + echo "Mounting NFS directories" + count=0 + while [ $count -lt $MAXCOUNT ] && ! mount -t nfs "${nfs_server_scratch}/${instance_name}" /scratch + do + sleep 5 + count=$[$count+1] + done + + mount -t nfs "${nfs_server_common}" /mnt/common + + # Overwrite nested VM image with latest as per NFS + if [ -f /mnt/common/nested-vm-current.img ] + then + rm -f /var/lib/vm/vhost-nested.img + cp /mnt/common/nested-vm-current.img /var/lib/vm/vhost-nested.img + fi + + mkdir /scratch/$(hostname) + cp /VERSION /scratch/$(hostname)/ + cat /var/lib/vm/vhost-nested.img | strings | grep NESTED_VERSION= > /scratch/$(hostname)/NESTED_VERSION + + exit 0 + + + + + + + + + + #cloud-config +bootcmd: +- ln -s -t /etc/rc.d /etc/rc.local +hostname: sut2 +manage_etc_hosts: true +nfs_server_scratch: $$NFS_SERVER_SCRATCH$$ +nfs_server_common: $$NFS_SERVER_COMMON$$ +runcmd: +- start ttyS0 +- systemctl start getty@ttyS0.service +- systemctl start rc-local +- sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config +- echo "UseDNS no" >> /etc/ssh/sshd_config +- service ssh restart +- service sshd restart +- sed -i 's/no-pci//' /opt/cisco/vpe/etc/qn.conf +- sed -i 's/1024/1024 decimal-interface-names/g' /opt/cisco/vpe/etc/qn.conf +users: +- default +- gecos: User configured by VIRL Configuration Engine 0.21.4 + lock-passwd: false + name: cisco + plain-text-passwd: cisco + shell: /bin/bash + ssh-authorized-keys: + - VIRL-USER-SSH-PUBLIC-KEY + - VIRL-USER-SSH-PUBLIC-KEY + sudo: ALL=(ALL) NOPASSWD:ALL +write_files: +- path: /etc/init/ttyS0.conf + owner: root:root + content: | + # ttyS0 - getty + # This service maintains a getty on ttyS0 from the point the system is + # started until it is shut down again. + start on stopped rc or RUNLEVEL=[12345] + stop on runlevel [!12345] + respawn + exec /sbin/getty -L 115200 ttyS0 vt102 + permissions: '0644' +- path: /etc/systemd/system/dhclient@.service + content: | + [Unit] + Description=Run dhclient on %i interface + After=network.target + [Service] + Type=oneshot + ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease + RemainAfterExit=yes + owner: root:root + permissions: '0644' +- path: /usr/local/sbin/cloud-instance-name + content: | + #!/usr/bin/python + import pickle + print pickle.loads(open('/var/lib/cloud/instance/obj.pkl').read()).metadata['name'] + owner: root:root + permissions: '0755' +- path: /etc/rc.local + owner: root:root + permissions: '0755' + content: |- + #!/bin/sh + grep -q nfs_server_scratch /var/lib/cloud/instance/user-data.txt || exit 1 + grep -q nfs_server_common /var/lib/cloud/instance/user-data.txt || exit 1 + nfs_server_scratch=$(grep -E '^nfs_server_scratch:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }') + nfs_server_common=$(grep -E '^nfs_server_common:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }') + instance_name=$(/usr/local/sbin/cloud-instance-name | cut -f 3 -d '<' | cut -f 1 -d '>') + echo My instance name is $instance_name + + MAXCOUNT=12 + RETRY=5 + + mkdir -p /scratch + mkdir -p /mnt/common + + echo "Mounting NFS directories" + count=0 + while [ $count -lt $MAXCOUNT ] && ! mount -t nfs "${nfs_server_scratch}/${instance_name}" /scratch + do + sleep 5 + count=$[$count+1] + done + + mount -t nfs "${nfs_server_common}" /mnt/common + + # Overwrite nested VM image with latest as per NFS + if [ -f /mnt/common/nested-vm-current.img ] + then + rm -f /var/lib/vm/vhost-nested.img + cp /mnt/common/nested-vm-current.img /var/lib/vm/vhost-nested.img + fi + + mkdir /scratch/$(hostname) + cp /VERSION /scratch/$(hostname)/ + cat /var/lib/vm/vhost-nested.img | strings | grep NESTED_VERSION= > /scratch/$(hostname)/NESTED_VERSION + + exit 0 + + + + + + + + + + + + + + diff --git a/resources/tools/virl/topologies/double-ring-nested.trusty.yaml b/resources/tools/virl/topologies/double-ring-nested.trusty.yaml new file mode 100644 index 0000000000..94daa1dbba --- /dev/null +++ b/resources/tools/virl/topologies/double-ring-nested.trusty.yaml @@ -0,0 +1,95 @@ +--- +metadata: + version: 0.1 + schema: + - resources/topology_schemas/3_node_topology.sch.yaml + - resources/topology_schemas/topology.sch.yaml + tags: [hw, 3-node] + +honeycomb: &honeycomb + user: admin + passwd: admin + port: 8183 + netconf_port: 2831 + +nodes: + TG: + type: TG + host: "{topology[tg1][nic-management][ip-addr]}" + port: 22 + username: cisco + priv_key: | +{priv_key} + interfaces: + port3: + mac_address: "{topology[tg1][nic-2][hw-addr]}" + pci_address: "0000:00:06.0" + link: link1 + driver: virtio-pci + port4: + mac_address: "{topology[tg1][nic-3][hw-addr]}" + pci_address: "0000:00:07.0" + link: link4 + driver: virtio-pci + port5: + mac_address: "{topology[tg1][nic-4][hw-addr]}" + pci_address: "0000:00:08.0" + link: link2 + driver: virtio-pci + port6: + mac_address: "{topology[tg1][nic-5][hw-addr]}" + pci_address: "0000:00:09.0" + link: link5 + driver: virtio-pci + DUT1: + type: DUT + host: "{topology[sut1][nic-management][ip-addr]}" + port: 22 + username: cisco + honeycomb: + <<: *honeycomb + priv_key: | +{priv_key} + interfaces: + port1: + mac_address: "{topology[sut1][nic-0][hw-addr]}" + pci_address: "0000:00:04.0" + link: link1 + port2: + mac_address: "{topology[sut1][nic-1][hw-addr]}" + pci_address: "0000:00:05.0" + link: link4 + port3: + mac_address: "{topology[sut1][nic-2][hw-addr]}" + pci_address: "0000:00:06.0" + link: link3 + port4: + mac_address: "{topology[sut1][nic-3][hw-addr]}" + pci_address: "0000:00:07.0" + link: link6 + DUT2: + type: DUT + host: "{topology[sut2][nic-management][ip-addr]}" + port: 22 + username: cisco + honeycomb: + <<: *honeycomb + priv_key: | +{priv_key} + interfaces: + port1: + mac_address: "{topology[sut2][nic-0][hw-addr]}" + pci_address: "0000:00:04.0" + link: link2 + port2: + mac_address: "{topology[sut2][nic-1][hw-addr]}" + pci_address: "0000:00:05.0" + link: link5 + port3: + mac_address: "{topology[sut2][nic-2][hw-addr]}" + pci_address: "0000:00:06.0" + link: link3 + port4: + mac_address: "{topology[sut2][nic-3][hw-addr]}" + pci_address: "0000:00:07.0" + link: link6 diff --git a/resources/tools/virl/topologies/double-ring-nested.virl b/resources/tools/virl/topologies/double-ring-nested.virl deleted file mode 100644 index 4dd5885281..0000000000 --- a/resources/tools/virl/topologies/double-ring-nested.virl +++ /dev/null @@ -1,327 +0,0 @@ - - - - flat - - - - #cloud-config -bootcmd: -- ln -s -t /etc/rc.d /etc/rc.local -hostname: tg1 -manage_etc_hosts: true -nfs_server_scratch: $$NFS_SERVER_SCRATCH$$ -nfs_server_common: $$NFS_SERVER_COMMON$$ -runcmd: -- start ttyS0 -- systemctl start getty@ttyS0.service -- systemctl start rc-local -- touch /tmp/before-sed -- sed -i 's/^\s*PasswordAuthentication\s\+no/PasswordAuthentication yes/' /etc/ssh/sshd_config -- echo "UseDNS no" >> /etc/ssh/sshd_config -- service ssh restart -- service sshd restart -users: -- default -- gecos: User configured by VIRL Configuration Engine 0.21.4 - lock-passwd: false - name: cisco - plain-text-passwd: cisco - shell: /bin/bash - ssh-authorized-keys: - - VIRL-USER-SSH-PUBLIC-KEY - - VIRL-USER-SSH-PUBLIC-KEY - sudo: ALL=(ALL) NOPASSWD:ALL -write_files: -- path: /etc/init/ttyS0.conf - owner: root:root - content: | - # ttyS0 - getty - # This service maintains a getty on ttyS0 from the point the system is - # started until it is shut down again. - start on stopped rc or RUNLEVEL=[12345] - stop on runlevel [!12345] - respawn - exec /sbin/getty -L 115200 ttyS0 vt102 - permissions: '0644' -- path: /etc/systemd/system/dhclient@.service - content: | - [Unit] - Description=Run dhclient on %i interface - After=network.target - [Service] - Type=oneshot - ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease - RemainAfterExit=yes - owner: root:root - permissions: '0644' -- path: /usr/local/sbin/cloud-instance-name - content: | - #!/usr/bin/python - import pickle - print pickle.loads(open('/var/lib/cloud/instance/obj.pkl').read()).metadata['name'] - owner: root:root - permissions: '0755' -- path: /etc/rc.local - owner: root:root - permissions: '0755' - content: |- - #!/bin/sh - grep -q nfs_server_scratch /var/lib/cloud/instance/user-data.txt || exit 1 - grep -q nfs_server_common /var/lib/cloud/instance/user-data.txt || exit 1 - nfs_server_scratch=$(grep -E '^nfs_server_scratch:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }') - nfs_server_common=$(grep -E '^nfs_server_common:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }') - instance_name=$(/usr/local/sbin/cloud-instance-name | cut -f 3 -d '<' | cut -f 1 -d '>') - echo My instance name is $instance_name - - MAXCOUNT=12 - RETRY=5 - - mkdir -p /scratch - mkdir -p /mnt/common - - echo "Mounting NFS directories" - count=0 - while [ $count -lt $MAXCOUNT ] && ! mount -t nfs "${nfs_server_scratch}/${instance_name}" /scratch - do - sleep 5 - count=$[$count+1] - done - - mount -t nfs "${nfs_server_common}" /mnt/common - - mkdir /scratch/$(hostname) - cp /VERSION /scratch/$(hostname)/ - - exit 0 - - false - - - - - - - - - - - #cloud-config -bootcmd: -- ln -s -t /etc/rc.d /etc/rc.local -hostname: sut1 -manage_etc_hosts: true -nfs_server_scratch: $$NFS_SERVER_SCRATCH$$ -nfs_server_common: $$NFS_SERVER_COMMON$$ -runcmd: -- start ttyS0 -- systemctl start getty@ttyS0.service -- systemctl start rc-local -- sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config -- echo "UseDNS no" >> /etc/ssh/sshd_config -- service ssh restart -- service sshd restart -- sed -i 's/no-pci//' /opt/cisco/vpe/etc/qn.conf -- sed -i 's/1024/1024 decimal-interface-names/g' /opt/cisco/vpe/etc/qn.conf -users: -- default -- gecos: User configured by VIRL Configuration Engine 0.21.4 - lock-passwd: false - name: cisco - plain-text-passwd: cisco - shell: /bin/bash - ssh-authorized-keys: - - VIRL-USER-SSH-PUBLIC-KEY - - VIRL-USER-SSH-PUBLIC-KEY - sudo: ALL=(ALL) NOPASSWD:ALL -write_files: -- path: /etc/init/ttyS0.conf - owner: root:root - content: | - # ttyS0 - getty - # This service maintains a getty on ttyS0 from the point the system is - # started until it is shut down again. - start on stopped rc or RUNLEVEL=[12345] - stop on runlevel [!12345] - respawn - exec /sbin/getty -L 115200 ttyS0 vt102 - permissions: '0644' -- path: /etc/systemd/system/dhclient@.service - content: | - [Unit] - Description=Run dhclient on %i interface - After=network.target - [Service] - Type=oneshot - ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease - RemainAfterExit=yes - owner: root:root - permissions: '0644' -- path: /usr/local/sbin/cloud-instance-name - content: | - #!/usr/bin/python - import pickle - print pickle.loads(open('/var/lib/cloud/instance/obj.pkl').read()).metadata['name'] - owner: root:root - permissions: '0755' -- path: /etc/rc.local - owner: root:root - permissions: '0755' - content: |- - #!/bin/sh - grep -q nfs_server_scratch /var/lib/cloud/instance/user-data.txt || exit 1 - grep -q nfs_server_common /var/lib/cloud/instance/user-data.txt || exit 1 - nfs_server_scratch=$(grep -E '^nfs_server_scratch:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }') - nfs_server_common=$(grep -E '^nfs_server_common:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }') - instance_name=$(/usr/local/sbin/cloud-instance-name | cut -f 3 -d '<' | cut -f 1 -d '>') - echo My instance name is $instance_name - - MAXCOUNT=12 - RETRY=5 - - mkdir -p /scratch - mkdir -p /mnt/common - - echo "Mounting NFS directories" - count=0 - while [ $count -lt $MAXCOUNT ] && ! mount -t nfs "${nfs_server_scratch}/${instance_name}" /scratch - do - sleep 5 - count=$[$count+1] - done - - mount -t nfs "${nfs_server_common}" /mnt/common - - # Overwrite nested VM image with latest as per NFS - if [ -f /mnt/common/nested-vm-current.img ] - then - rm -f /var/lib/vm/vhost-nested.img - cp /mnt/common/nested-vm-current.img /var/lib/vm/vhost-nested.img - fi - - mkdir /scratch/$(hostname) - cp /VERSION /scratch/$(hostname)/ - cat /var/lib/vm/vhost-nested.img | strings | grep NESTED_VERSION= > /scratch/$(hostname)/NESTED_VERSION - - exit 0 - - - - - - - - - - #cloud-config -bootcmd: -- ln -s -t /etc/rc.d /etc/rc.local -hostname: sut2 -manage_etc_hosts: true -nfs_server_scratch: $$NFS_SERVER_SCRATCH$$ -nfs_server_common: $$NFS_SERVER_COMMON$$ -runcmd: -- start ttyS0 -- systemctl start getty@ttyS0.service -- systemctl start rc-local -- sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config -- echo "UseDNS no" >> /etc/ssh/sshd_config -- service ssh restart -- service sshd restart -- sed -i 's/no-pci//' /opt/cisco/vpe/etc/qn.conf -- sed -i 's/1024/1024 decimal-interface-names/g' /opt/cisco/vpe/etc/qn.conf -users: -- default -- gecos: User configured by VIRL Configuration Engine 0.21.4 - lock-passwd: false - name: cisco - plain-text-passwd: cisco - shell: /bin/bash - ssh-authorized-keys: - - VIRL-USER-SSH-PUBLIC-KEY - - VIRL-USER-SSH-PUBLIC-KEY - sudo: ALL=(ALL) NOPASSWD:ALL -write_files: -- path: /etc/init/ttyS0.conf - owner: root:root - content: | - # ttyS0 - getty - # This service maintains a getty on ttyS0 from the point the system is - # started until it is shut down again. - start on stopped rc or RUNLEVEL=[12345] - stop on runlevel [!12345] - respawn - exec /sbin/getty -L 115200 ttyS0 vt102 - permissions: '0644' -- path: /etc/systemd/system/dhclient@.service - content: | - [Unit] - Description=Run dhclient on %i interface - After=network.target - [Service] - Type=oneshot - ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease - RemainAfterExit=yes - owner: root:root - permissions: '0644' -- path: /usr/local/sbin/cloud-instance-name - content: | - #!/usr/bin/python - import pickle - print pickle.loads(open('/var/lib/cloud/instance/obj.pkl').read()).metadata['name'] - owner: root:root - permissions: '0755' -- path: /etc/rc.local - owner: root:root - permissions: '0755' - content: |- - #!/bin/sh - grep -q nfs_server_scratch /var/lib/cloud/instance/user-data.txt || exit 1 - grep -q nfs_server_common /var/lib/cloud/instance/user-data.txt || exit 1 - nfs_server_scratch=$(grep -E '^nfs_server_scratch:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }') - nfs_server_common=$(grep -E '^nfs_server_common:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }') - instance_name=$(/usr/local/sbin/cloud-instance-name | cut -f 3 -d '<' | cut -f 1 -d '>') - echo My instance name is $instance_name - - MAXCOUNT=12 - RETRY=5 - - mkdir -p /scratch - mkdir -p /mnt/common - - echo "Mounting NFS directories" - count=0 - while [ $count -lt $MAXCOUNT ] && ! mount -t nfs "${nfs_server_scratch}/${instance_name}" /scratch - do - sleep 5 - count=$[$count+1] - done - - mount -t nfs "${nfs_server_common}" /mnt/common - - # Overwrite nested VM image with latest as per NFS - if [ -f /mnt/common/nested-vm-current.img ] - then - rm -f /var/lib/vm/vhost-nested.img - cp /mnt/common/nested-vm-current.img /var/lib/vm/vhost-nested.img - fi - - mkdir /scratch/$(hostname) - cp /VERSION /scratch/$(hostname)/ - cat /var/lib/vm/vhost-nested.img | strings | grep NESTED_VERSION= > /scratch/$(hostname)/NESTED_VERSION - - exit 0 - - - - - - - - - - - - - - diff --git a/resources/tools/virl/topologies/double-ring-nested.xenial.virl b/resources/tools/virl/topologies/double-ring-nested.xenial.virl new file mode 100644 index 0000000000..65733f9caf --- /dev/null +++ b/resources/tools/virl/topologies/double-ring-nested.xenial.virl @@ -0,0 +1,362 @@ + + + + flat + + + + #cloud-config +bootcmd: +- ln -s -t /etc/rc.d /etc/rc.local +hostname: tg1 +manage_etc_hosts: true +nfs_server_scratch: $$NFS_SERVER_SCRATCH$$ +nfs_server_common: $$NFS_SERVER_COMMON$$ +runcmd: +- systemctl start getty@ttyS0.service +- systemctl start rc-local +- touch /tmp/before-sed +- sed -i 's/^\s*PasswordAuthentication\s\+no/PasswordAuthentication yes/' /etc/ssh/sshd_config +- echo "UseDNS no" >> /etc/ssh/sshd_config +- service ssh restart +- service sshd restart +users: +- default +- gecos: User configured by VIRL Configuration Engine 0.21.4 + lock-passwd: false + name: cisco + plain-text-passwd: cisco + shell: /bin/bash + ssh-authorized-keys: + - VIRL-USER-SSH-PUBLIC-KEY + - VIRL-USER-SSH-PUBLIC-KEY + sudo: ALL=(ALL) NOPASSWD:ALL +write_files: +- path: /etc/init/ttyS0.conf + owner: root:root + content: | + # ttyS0 - getty + # This service maintains a getty on ttyS0 from the point the system is + # started until it is shut down again. + start on stopped rc or RUNLEVEL=[12345] + stop on runlevel [!12345] + respawn + exec /sbin/getty -L 115200 ttyS0 vt102 + permissions: '0644' +- path: /etc/systemd/system/dhclient@.service + content: | + [Unit] + Description=Run dhclient on %i interface + After=network.target + [Service] + Type=oneshot + ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease + RemainAfterExit=yes + owner: root:root + permissions: '0644' +- path: /usr/local/sbin/cloud-instance-name + content: | + #!/usr/bin/python3.5 + import pickle + print(pickle.loads(open('/var/lib/cloud/instance/obj.pkl', 'rb').read(), encoding="ACSII").metadata['name']) + owner: root:root + permissions: '0755' +- path: /etc/rc.local + owner: root:root + permissions: '0755' + content: |- + #!/bin/sh + grep -q nfs_server_scratch /var/lib/cloud/instance/user-data.txt || exit 1 + grep -q nfs_server_common /var/lib/cloud/instance/user-data.txt || exit 1 + nfs_server_scratch=$(grep -E '^nfs_server_scratch:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }') + nfs_server_common=$(grep -E '^nfs_server_common:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }') + instance_name=$(/usr/local/sbin/cloud-instance-name | cut -f 3 -d '<' | cut -f 1 -d '>') + echo My instance name is $instance_name + + MAXCOUNT=12 + RETRY=5 + + mkdir -p /scratch + mkdir -p /mnt/common + + echo "Mounting NFS directories" + count=0 + while [ $count -lt $MAXCOUNT ] && ! mount -t nfs "${nfs_server_scratch}/${instance_name}" /scratch + do + sleep 5 + count=$[$count+1] + done + + mount -t nfs "${nfs_server_common}" /mnt/common + + mkdir /scratch/$(hostname) + cp /VERSION /scratch/$(hostname)/ + + exit 0 + + false + + + + + + + + + + + #cloud-config +bootcmd: +- ln -s -t /etc/rc.d /etc/rc.local +hostname: sut1 +manage_etc_hosts: true +nfs_server_scratch: $$NFS_SERVER_SCRATCH$$ +nfs_server_common: $$NFS_SERVER_COMMON$$ +runcmd: +- systemctl start getty@ttyS0.service +- systemctl start rc-local +- sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config +- echo "UseDNS no" >> /etc/ssh/sshd_config +- service ssh restart +- service sshd restart +- sed -i 's/no-pci//' /opt/cisco/vpe/etc/qn.conf +- sed -i 's/1024/1024 decimal-interface-names/g' /opt/cisco/vpe/etc/qn.conf +- ln -s /dev/null /etc/sysctl.d/80-vpp.conf +users: +- default +- gecos: User configured by VIRL Configuration Engine 0.21.4 + lock-passwd: false + name: cisco + plain-text-passwd: cisco + shell: /bin/bash + ssh-authorized-keys: + - VIRL-USER-SSH-PUBLIC-KEY + - VIRL-USER-SSH-PUBLIC-KEY + sudo: ALL=(ALL) NOPASSWD:ALL +write_files: +- path: /etc/init/ttyS0.conf + owner: root:root + content: | + # ttyS0 - getty + # This service maintains a getty on ttyS0 from the point the system is + # started until it is shut down again. + start on stopped rc or RUNLEVEL=[12345] + stop on runlevel [!12345] + respawn + exec /sbin/getty -L 115200 ttyS0 vt102 + permissions: '0644' +- path: /etc/systemd/system/dhclient@.service + content: | + [Unit] + Description=Run dhclient on %i interface + After=network.target + [Service] + Type=oneshot + ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease + RemainAfterExit=yes + owner: root:root + permissions: '0644' +- path: /usr/local/sbin/cloud-instance-name + content: | + #!/usr/bin/python3.5 + import pickle + print(pickle.loads(open('/var/lib/cloud/instance/obj.pkl', 'rb').read(), encoding="ACSII").metadata['name']) + owner: root:root + permissions: '0755' +- path: /etc/rc.local + owner: root:root + permissions: '0755' + content: |- + #!/bin/sh + grep -q nfs_server_scratch /var/lib/cloud/instance/user-data.txt || exit 1 + grep -q nfs_server_common /var/lib/cloud/instance/user-data.txt || exit 1 + nfs_server_scratch=$(grep -E '^nfs_server_scratch:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }') + nfs_server_common=$(grep -E '^nfs_server_common:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }') + instance_name=$(/usr/local/sbin/cloud-instance-name | cut -f 3 -d '<' | cut -f 1 -d '>') + echo My instance name is $instance_name + + MAXCOUNT=12 + RETRY=5 + + mkdir -p /scratch + mkdir -p /mnt/common + + echo "Mounting NFS directories" + count=0 + while [ $count -lt $MAXCOUNT ] && ! mount -t nfs "${nfs_server_scratch}/${instance_name}" /scratch + do + sleep 5 + count=$[$count+1] + done + + mount -t nfs "${nfs_server_common}" /mnt/common + + # Overwrite nested VM image with latest as per NFS + if [ -f /mnt/common/nested-vm-current.img ] + then + rm -f /var/lib/vm/vhost-nested.img + cp /mnt/common/nested-vm-current.img /var/lib/vm/vhost-nested.img + fi + + mkdir /scratch/$(hostname) + cp /VERSION /scratch/$(hostname)/ + cat /var/lib/vm/vhost-nested.img | strings | grep NESTED_VERSION= > /scratch/$(hostname)/NESTED_VERSION + + exit 0 +- path: /etc/sysctl.d/90-csit.conf + owner: root:root + content: | + # Number of 2MB hugepages desired + vm.nr_hugepages=1024 + + # Must be greater than or equal to (2 * vm.nr_hugepages). + vm.max_map_count=20000 + + # All groups allowed to access hugepages + vm.hugetlb_shm_group=0 + + # Shared Memory Max must be greator or equal to the total size of hugepages. + # For 2MB pages, TotalHugepageSize = vm.nr_hugepages * 2 * 1024 * 1024 + # If the existing kernel.shmmax setting (cat /sys/proc/kernel/shmmax) + # is greater than the calculated TotalHugepageSize then set this parameter + # to current shmmax value. + kernel.shmmax=2147483648 + + + + + + + + + + #cloud-config +bootcmd: +- ln -s -t /etc/rc.d /etc/rc.local +hostname: sut2 +manage_etc_hosts: true +nfs_server_scratch: $$NFS_SERVER_SCRATCH$$ +nfs_server_common: $$NFS_SERVER_COMMON$$ +runcmd: +- systemctl start getty@ttyS0.service +- systemctl start rc-local +- sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config +- echo "UseDNS no" >> /etc/ssh/sshd_config +- service ssh restart +- service sshd restart +- sed -i 's/no-pci//' /opt/cisco/vpe/etc/qn.conf +- sed -i 's/1024/1024 decimal-interface-names/g' /opt/cisco/vpe/etc/qn.conf +- ln -s /dev/null /etc/sysctl.d/80-vpp.conf +users: +- default +- gecos: User configured by VIRL Configuration Engine 0.21.4 + lock-passwd: false + name: cisco + plain-text-passwd: cisco + shell: /bin/bash + ssh-authorized-keys: + - VIRL-USER-SSH-PUBLIC-KEY + - VIRL-USER-SSH-PUBLIC-KEY + sudo: ALL=(ALL) NOPASSWD:ALL +write_files: +- path: /etc/init/ttyS0.conf + owner: root:root + content: | + # ttyS0 - getty + # This service maintains a getty on ttyS0 from the point the system is + # started until it is shut down again. + start on stopped rc or RUNLEVEL=[12345] + stop on runlevel [!12345] + respawn + exec /sbin/getty -L 115200 ttyS0 vt102 + permissions: '0644' +- path: /etc/systemd/system/dhclient@.service + content: | + [Unit] + Description=Run dhclient on %i interface + After=network.target + [Service] + Type=oneshot + ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease + RemainAfterExit=yes + owner: root:root + permissions: '0644' +- path: /usr/local/sbin/cloud-instance-name + content: | + #!/usr/bin/python3.5 + import pickle + print(pickle.loads(open('/var/lib/cloud/instance/obj.pkl', 'rb').read(), encoding="ACSII").metadata['name']) + owner: root:root + permissions: '0755' +- path: /etc/rc.local + owner: root:root + permissions: '0755' + content: |- + #!/bin/sh + grep -q nfs_server_scratch /var/lib/cloud/instance/user-data.txt || exit 1 + grep -q nfs_server_common /var/lib/cloud/instance/user-data.txt || exit 1 + nfs_server_scratch=$(grep -E '^nfs_server_scratch:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }') + nfs_server_common=$(grep -E '^nfs_server_common:' /var/lib/cloud/instance/user-data.txt | awk '{ print $2 }') + instance_name=$(/usr/local/sbin/cloud-instance-name | cut -f 3 -d '<' | cut -f 1 -d '>') + echo My instance name is $instance_name + + MAXCOUNT=12 + RETRY=5 + + mkdir -p /scratch + mkdir -p /mnt/common + + echo "Mounting NFS directories" + count=0 + while [ $count -lt $MAXCOUNT ] && ! mount -t nfs "${nfs_server_scratch}/${instance_name}" /scratch + do + sleep 5 + count=$[$count+1] + done + + mount -t nfs "${nfs_server_common}" /mnt/common + + # Overwrite nested VM image with latest as per NFS + if [ -f /mnt/common/nested-vm-current.img ] + then + rm -f /var/lib/vm/vhost-nested.img + cp /mnt/common/nested-vm-current.img /var/lib/vm/vhost-nested.img + fi + + mkdir /scratch/$(hostname) + cp /VERSION /scratch/$(hostname)/ + cat /var/lib/vm/vhost-nested.img | strings | grep NESTED_VERSION= > /scratch/$(hostname)/NESTED_VERSION + + exit 0 +- path: /etc/sysctl.d/90-csit.conf + owner: root:root + content: | + # Number of 2MB hugepages desired + vm.nr_hugepages=1024 + + # Must be greater than or equal to (2 * vm.nr_hugepages). + vm.max_map_count=20000 + + # All groups allowed to access hugepages + vm.hugetlb_shm_group=0 + + # Shared Memory Max must be greator or equal to the total size of hugepages. + # For 2MB pages, TotalHugepageSize = vm.nr_hugepages * 2 * 1024 * 1024 + # If the existing kernel.shmmax setting (cat /sys/proc/kernel/shmmax) + # is greater than the calculated TotalHugepageSize then set this parameter + # to current shmmax value. + kernel.shmmax=2147483648 + + + + + + + + + + + + + + diff --git a/resources/tools/virl/topologies/double-ring-nested.xenial.yaml b/resources/tools/virl/topologies/double-ring-nested.xenial.yaml new file mode 100644 index 0000000000..bc3df7bdb8 --- /dev/null +++ b/resources/tools/virl/topologies/double-ring-nested.xenial.yaml @@ -0,0 +1,95 @@ +--- +metadata: + version: 0.1 + schema: + - resources/topology_schemas/3_node_topology.sch.yaml + - resources/topology_schemas/topology.sch.yaml + tags: [hw, 3-node] + +honeycomb: &honeycomb + user: admin + passwd: admin + port: 8181 + netconf_port: 1830 + +nodes: + TG: + type: TG + host: "{topology[tg1][nic-management][ip-addr]}" + port: 22 + username: cisco + priv_key: | +{priv_key} + interfaces: + port3: + mac_address: "{topology[tg1][nic-2][hw-addr]}" + pci_address: "0000:00:06.0" + link: link1 + driver: virtio-pci + port4: + mac_address: "{topology[tg1][nic-3][hw-addr]}" + pci_address: "0000:00:07.0" + link: link4 + driver: virtio-pci + port5: + mac_address: "{topology[tg1][nic-4][hw-addr]}" + pci_address: "0000:00:08.0" + link: link2 + driver: virtio-pci + port6: + mac_address: "{topology[tg1][nic-5][hw-addr]}" + pci_address: "0000:00:09.0" + link: link5 + driver: virtio-pci + DUT1: + type: DUT + host: "{topology[sut1][nic-management][ip-addr]}" + port: 22 + username: cisco + honeycomb: + <<: *honeycomb + priv_key: | +{priv_key} + interfaces: + port1: + mac_address: "{topology[sut1][nic-0][hw-addr]}" + pci_address: "0000:00:04.0" + link: link1 + port2: + mac_address: "{topology[sut1][nic-1][hw-addr]}" + pci_address: "0000:00:05.0" + link: link4 + port3: + mac_address: "{topology[sut1][nic-2][hw-addr]}" + pci_address: "0000:00:06.0" + link: link3 + port4: + mac_address: "{topology[sut1][nic-3][hw-addr]}" + pci_address: "0000:00:07.0" + link: link6 + DUT2: + type: DUT + host: "{topology[sut2][nic-management][ip-addr]}" + port: 22 + username: cisco + honeycomb: + <<: *honeycomb + priv_key: | +{priv_key} + interfaces: + port1: + mac_address: "{topology[sut2][nic-0][hw-addr]}" + pci_address: "0000:00:04.0" + link: link2 + port2: + mac_address: "{topology[sut2][nic-1][hw-addr]}" + pci_address: "0000:00:05.0" + link: link5 + port3: + mac_address: "{topology[sut2][nic-2][hw-addr]}" + pci_address: "0000:00:06.0" + link: link3 + port4: + mac_address: "{topology[sut2][nic-3][hw-addr]}" + pci_address: "0000:00:07.0" + link: link6 diff --git a/resources/tools/virl/topologies/double-ring-nested.yaml b/resources/tools/virl/topologies/double-ring-nested.yaml deleted file mode 100644 index 94daa1dbba..0000000000 --- a/resources/tools/virl/topologies/double-ring-nested.yaml +++ /dev/null @@ -1,95 +0,0 @@ ---- -metadata: - version: 0.1 - schema: - - resources/topology_schemas/3_node_topology.sch.yaml - - resources/topology_schemas/topology.sch.yaml - tags: [hw, 3-node] - -honeycomb: &honeycomb - user: admin - passwd: admin - port: 8183 - netconf_port: 2831 - -nodes: - TG: - type: TG - host: "{topology[tg1][nic-management][ip-addr]}" - port: 22 - username: cisco - priv_key: | -{priv_key} - interfaces: - port3: - mac_address: "{topology[tg1][nic-2][hw-addr]}" - pci_address: "0000:00:06.0" - link: link1 - driver: virtio-pci - port4: - mac_address: "{topology[tg1][nic-3][hw-addr]}" - pci_address: "0000:00:07.0" - link: link4 - driver: virtio-pci - port5: - mac_address: "{topology[tg1][nic-4][hw-addr]}" - pci_address: "0000:00:08.0" - link: link2 - driver: virtio-pci - port6: - mac_address: "{topology[tg1][nic-5][hw-addr]}" - pci_address: "0000:00:09.0" - link: link5 - driver: virtio-pci - DUT1: - type: DUT - host: "{topology[sut1][nic-management][ip-addr]}" - port: 22 - username: cisco - honeycomb: - <<: *honeycomb - priv_key: | -{priv_key} - interfaces: - port1: - mac_address: "{topology[sut1][nic-0][hw-addr]}" - pci_address: "0000:00:04.0" - link: link1 - port2: - mac_address: "{topology[sut1][nic-1][hw-addr]}" - pci_address: "0000:00:05.0" - link: link4 - port3: - mac_address: "{topology[sut1][nic-2][hw-addr]}" - pci_address: "0000:00:06.0" - link: link3 - port4: - mac_address: "{topology[sut1][nic-3][hw-addr]}" - pci_address: "0000:00:07.0" - link: link6 - DUT2: - type: DUT - host: "{topology[sut2][nic-management][ip-addr]}" - port: 22 - username: cisco - honeycomb: - <<: *honeycomb - priv_key: | -{priv_key} - interfaces: - port1: - mac_address: "{topology[sut2][nic-0][hw-addr]}" - pci_address: "0000:00:04.0" - link: link2 - port2: - mac_address: "{topology[sut2][nic-1][hw-addr]}" - pci_address: "0000:00:05.0" - link: link5 - port3: - mac_address: "{topology[sut2][nic-2][hw-addr]}" - pci_address: "0000:00:06.0" - link: link3 - port4: - mac_address: "{topology[sut2][nic-3][hw-addr]}" - pci_address: "0000:00:07.0" - link: link6 -- cgit 1.2.3-korg