Add the Juniper vMX node and image defs.

This is EXPERIMENTAL at this point.
This commit is contained in:
Joe Clarke
2021-08-27 16:58:45 -04:00
parent 32b135e9a8
commit fa0a5d338c
7 changed files with 245 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
# Juniper Node Definitions
Here you will find collections of Juniper node definitions.

View File

@@ -0,0 +1,67 @@
# Juniper vMX Node Definitions
This directory contains the following node definitions:
* `jnpr-vmx-vcp.yaml` - Juniper vMX virtual control plane node definition
* `jnpr-vmx-vfp.yaml` - Juniper vMX virtual forwarding plane node definition
## Requirements
- CML 2.1.0 or higher
- Juniper vMX image distribution (tested with `vmx-bundle-17.3R3-S4.2.tar.zip`)
- The two node definitions above
- The image definition templates from https://github.com/CiscoDevNet/cml-community/tree/master/virl-base-images/juniper/vmx
## Steps
1. Extract the vMX image distribution `.tar.zip` file into a directory on your local machine. From that archive, you will use the following files:
- `junos-vmx-x86-64-VERSION`
- `metadata-usb-re`
- `vFPC-VERSION`
- `vmxhdd`
2. Enable the OpenSSH sshd service in Cockpit on your CML server by going to Cockpit > Terminal and running the following command: `sudo systemctl enable sshd && sudo systemctl start sshd`
3. Download the `jnpr-vmx-vcp-17-3.yaml` and `jnpr-vmx-vfp-17-3.yaml` **image definitions** from the link above.
4. Edit these files to ensure that the versions found within are consistent with the version of vMX JunOS you have downloaded from Juniper.
5. In the Cockpit > Terminal, run the following command to shutdown the CML services: `sudo systemctl stop virl2.target`
6. Copy the two image definition files as well as the four disk images above to the CML server using Secure Copy (scp). From macOS or Linux, this can be done with the following command: `scp -P1122 folder_with_disks_and_image_defs/* sysadmin@10.10.10.10:` where 10.10.10.10 is your CML server's IP address and `folder_with_disks_and_image_defs` is a directory that contains all of the above disk images and image definition YAML files. Note the port number of 1122. This is the port used by the OpenSSH daemon. Also note the trailing ':'.
7. Back in Cockpit > Terminal, convert all of the disk images to qcow2 format using the following command: `qemu-img convert -cp -O diskname.oldformat diskname.qcow2`. Here, `-c` provides compressed images and `-p` provides progress feedback while converting.
8. Create a directory for the image definitions with the following command: `sudo mkdir -p /var/local/virl2/refplat/diff/virl-base-images/junos-vmx-17-3`. You can adjust the name of the directory to match your version of JunOS.
9. Copy all of the _converted_ disk images and the two image definition YAML files into this directory with the command: `sudo cp filename /var/local/virl2/refplat/diff/virl-base-images/junos-vmx-17-3/`. Repeat this command to copy each file. When done, the contents of `/var/local/virl2/refplat/diff/virl-base-images/junos-vmx-17-3` should look like the following:
- `jnpr-vmx-vcp-17-3.yaml`
- `jnpr-vmx-vfp-17-3.yaml`
- `junos-vmx-x86-64-17.3R3-S4.2.qcow2`
- `metadata-usb-re.qcow2`
- `vFPC-20181016.qcow2`
- `vmxcdd.qcow2`
**Note:** The version components may be different in your specific case.
10. Restart the CML services with the command: `sudo systemctl start virl2.target`
11. Go to Tools > Node and Image Definitions > Node Definitions and import the `jnpr-vmx-vcp.yaml` and `jnpr-vmx-vfp.yaml` files found in this repo directory.
If all has gone well, you can now start using the vMX nodes in your labs. **Note:** when building labs with the vMX, you _must_ connect both node types (VCP and VFP) to each other, and the connection between the control and forwarding planes must be established on the second interface of both nodes.
At this point, you can disable the OpenSSH sshd on the CML server if you wish. To do that, run the following command from Cockpit > Terminal: `sudo systemctl stop sshd && sudo systemctl disable sshd`.
## Enabling Config Extraction Support
The VCP node definition already have base support for configuration extraction, but you will need to go to the Node Definition editor within CML (under Tools > Node and Image Definitions > Node Definitions), select the VCP node definition, scroll down to the **pyATS** section, and fill in the Username and Password you will use for your vMX nodes. After doing this, you can effectively use the CML configuration extraction feature on the VCP nodes. The VFP node does not support nor does it need config extraction.
## Caveats
vMX support is considered **EXPERIMENTAL** within CML.

View File

@@ -0,0 +1,70 @@
#
# Juniper vMX virtual control plane (VCP) node definition
# generated 2020-04-20
# part of VIRL^2
#
id: jnpr-vmx-vcp
configuration:
generator:
driver: null
provisioning:
volume_name: disk
media_type: iso
files:
- name: configuration.txt
content: hostname insert_hostname_here
editable: true
inherited:
image:
ram: false
cpus: false
data_volume: false
boot_disk_size: false
node:
ram: false
cpus: false
data_volume: false
boot_disk_size: false
device:
interfaces:
has_loopback_zero: false
default_count: 2
physical:
- fxp0
- em1
serial_ports: 1
general:
description: Juniper vMX virtual CP (EXPERIMENTAL)
nature: router
read_only: true
schema_version: "0.0.1"
sim:
linux_native:
cpus: 1
disk_driver: ide
driver: server
libvirt_domain_driver: kvm
nic_driver: virtio
ram: 1024
boot:
timeout: 600
completed:
- "login:"
ui:
description: |2
Juniper vMX Virtual Control Plane
1024MB, 1 vCPU
##### Note
**EXPERIMENTAL**
group: Others
icon: router
label: Juniper vMX VCP
label_prefix: vmx-vcp-
visible: true
pyats:
os: junos
config_extract_command: show configuration
use_in_testbed: true

View File

@@ -0,0 +1,63 @@
#
# Juniper vMX virtual forwarding plane (VFP) node definition
# generated 2020-04-20
# part of VIRL^2
#
id: jnpr-vmx-vfp
configuration:
generator:
driver: null
inherited:
image:
ram: false
cpus: false
data_volume: false
boot_disk_size: false
node:
ram: false
cpus: false
data_volume: false
boot_disk_size: false
device:
interfaces:
has_loopback_zero: false
default_count: 4
physical:
- ext
- int
- ge-0/0/0
- ge-0/0/1
- ge-0/0/2
- ge-0/0/3
serial_ports: 1
general:
description: Juniper vMX VFP (EXPERIMENTAL)
nature: router
read_only: true
schema_version: "0.0.1"
sim:
linux_native:
cpus: 3
disk_driver: ide
driver: server
libvirt_domain_driver: kvm
nic_driver: virtio
ram: 4096
boot:
timeout: 600
completed:
- "login:"
ui:
description: |2
Juniper vMX Virtual Forwarding Plane VFP
4096MB 3 vCPUs
##### Note
**EXPERIMENTAL**
group: Others
icon: router
label: Juniper vMX VFP
label_prefix: vmx-vfp-
visible: true

View File

@@ -0,0 +1,5 @@
# Loading vMX Image Definitions
See the vMX [README](https://github.com/CiscoDevNet/cml-community/tree/master/node-definitions/juniper/vmx/README.md) on how to properly load these images definitions.
**Note:** new image definitions must be created from these files and loaded using the same process. It is _not_ possible to create image definitions for vMX via the CML UI at this time.

View File

@@ -0,0 +1,20 @@
#
# Juniper vMX experimental image definition
# control plane
# generated 2020-04-20
# part of VIRL^2
#
id: jnpr-vmx-vcp-17-3
label: Juniper virtual Control plane
description: |2
Juniper virtual Control plane
JunOS vMX x86-64 17.3R3-S4.2
node_definition_id: jnpr-vmx-vcp
disk_image: junos-vmx-x86-64-17.3R3-S4.2.qcow2
disk_image_2: vmxhdd.qcow2
disk_image_3: metadata-usb-re.qcow2
read_only: true
schema_version: "0.0.1"

View File

@@ -0,0 +1,17 @@
#
# Juniper vMX experimental image definition
# forwarding plane
# generated 2020-04-20
# part of VIRL^2
#
id: jnpr-vmx-vfp-17-3
label: Juniper forwarding plane
description: |2
Juniper virtual forwarding plane
JunOS vMX x86-64 17.3R3-S4.2
node_definition_id: jnpr-vmx-vfp
disk_image: vFPC-20181016.qcow2
read_only: true
schema_version: "0.0.1"