This is an old revision of the document!
INSTALLATION:
Based on https://codingpackets.com/blog/juniper-vqfx-vagrant-libvirt-box-install
mkdir -p ~/vagrant/boxes/juniper/vqfx cd ~/vagrant/boxes/juniper/vqfx cp /data/images/vqfx10k-pfe-virtualbox.box /root/vagrant/boxes/juniper/vqfx/ cp /data/images/jinstall-vqfx-10-f-17.4R1.16.img /root/vagrant/boxes/juniper/vqfx/ tar -xvf vqfx10k-pfe-virtualbox.box
qemu-img convert -f vmdk -O qcow2 packer-virtualbox-ovf-1520878605-disk001.vmdk pfe.qcow2
curl -O https://raw.githubusercontent.com/vagrant-libvirt/vagrant-libvirt/master/tools/create_box.sh
chmod 775 create_box.sh
echo '{"provider":"libvirt","format":"qcow2","virtual_size":6}' > metadata.json
bash create_box.sh pfe.qcow2
cat << EOF > pfe.json
{
"name": "juniper/vqfx-pfe",
"description": "Juniper vQFX Packet Forwarding Engine",
"versions": [
{
"version": "17.4R1.16",
"providers": [
{
"name": "libvirt",
"url": "file:///root/vagrant/boxes/juniper/vqfx/pfe.box"
}
]
}
]
}
EOF
vagrant box add pfe.json
mv jinstall-vqfx-10-f-17.4R1.16.img vqfx-re.qcow2
virt-install \
--name vqfx-re \
--os-type unix \
--memory 1024 \
--vcpus=1 \
--import \
--disk path=vqfx-re.qcow2,size=4,bus=ide,format=qcow2 \
--network=network:vagrant-libvirt,model=e1000 \
--network=network:vagrant-libvirt,model=e1000 \
--graphics none
# In console cli edit set interfaces em0 unit 0 family inet dhcp set system services ssh root-login allow set system root-authentication plain-text-password # Juniper commit and-quit show interfaces terse | match em0.0 em0.0 up up inet 192.168.121.74/24 exit Ctrl-Shift-]
ssh root@192.168.121.74 cli start shell user root # root shell cat << EOF > bootup.sh #! /bin/sh logger "STARTING sleep 60s to complete boot process" sleep 60 logger "AFTER 60s" logger "STARTING configuration using script" /usr/sbin/cli -c 'configure;set interfaces em0.0 family inet dhcp;commit comment "Commit by script"' EOF
chmod +x bootup.sh crontab -e @reboot /bin/sh /var/root/bootup.sh
cli
set system login user vagrant uid 2000 set system login user vagrant class super-user set system login user vagrant authentication encrypted-password "$6$lUoxFIpU$ZiC3/b2UNpGvasntcvkNV4WVDJXBeZ.VqE6yPezbaGOos17vM9BhlTH.LBJb9DZE8fCoBtH0RWNhrbaYpZqxJ/" set system login user vagrant authentication ssh-rsa "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" set system root-authentication encrypted-password "$1$nq.N1UsY$JxA/ESAj3KuXseXE597gg0" set system root-authentication ssh-rsa "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" set system host-name vqfx set system services ssh root-login allow set system services netconf ssh commit and-quit exit
ssh vagrant@192.168.121.74 -i ~/.vagrant.d/insecure_private_key exit
#Now from console delete interfaces em0 commit and-quit request system power-off virsh destroy vqfx-re
echo '{“provider”:“libvirt”,“format”:“qcow2”,“virtual_size”:4}' > metadata.json
bash create_box.sh vqfx-re.qcow2
cat << EOF > re.json
{
"name": "juniper/vqfx-re",
"description": "Juniper vQFX Routing Engine",
"versions": [
{
"version": "17.4R1.16",
"providers": [
{
"name": "libvirt",
"url": "file:///root/vagrant/boxes/juniper/vqfx/vqfx-re.box"
}
]
}
]
}
EOF
vagrant box add re.json
vagrant box list
cd /home/jaime.santos.amandi/junos-vqfx-vagrant-virtual-lab vagrant up