GithubHelp home page GithubHelp logo

mweisel / cisco-iosv-vagrant-libvirt Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 38 KB

A procedure for creating a Cisco IOSv Vagrant box for the libvirt provider.

License: MIT License

Shell 100.00%
cisco-ios vagrant-box libvirt-provider

cisco-iosv-vagrant-libvirt's Introduction

Vagrant

Cisco IOSv Vagrant box

A procedure for creating a Cisco IOSv Vagrant box for the libvirt provider.

Prerequisites

Steps

0. Verify the prerequisite tools are installed.

$ which git python ansible libvirtd virsh qemu-system-x86_64 expect telnet vagrant
$ vagrant plugin list
vagrant-libvirt (0.5.3, global)

1. Log in and download the CML-P reference platform ISO file to your Downloads directory.

2. Create a mount point directory.

$ sudo mkdir -p /mnt/iso

3. Mount the ISO file.

$ cd $HOME/Downloads
$ sudo mount -o loop refplat-20210511-fcs.iso /mnt/iso

4. Copy (and rename) the Cisco IOSv disk image file to the /var/lib/libvirt/images directory.

$ sudo cp /mnt/iso/virl-base-images/iosv-159-3-m3/vios-adventerprisek9-m.spa.159-3.m3.qcow2 /var/lib/libvirt/images/cisco-iosv.qcow2

5. Unmount the ISO file.

$ sudo umount /mnt/iso

6. Modify the file ownership and permissions. Note the owner may differ between Linux distributions.

Ubuntu 18.04

$ sudo chown libvirt-qemu:kvm /var/lib/libvirt/images/cisco-iosv.qcow2
$ sudo chmod u+x /var/lib/libvirt/images/cisco-iosv.qcow2

Arch Linux

$ sudo chown nobody:kvm /var/lib/libvirt/images/cisco-iosv.qcow2
$ sudo chmod u+x /var/lib/libvirt/images/cisco-iosv.qcow2

7. Create the boxes directory.

$ mkdir -p $HOME/boxes

8. Start the vagrant-libvirt network (if not already started).

$ virsh -c qemu:///system net-list
$ virsh -c qemu:///system net-start vagrant-libvirt

9. Clone this GitHub repo and cd into the directory.

$ git clone https://github.com/mweisel/cisco-iosv-vagrant-libvirt
$ cd cisco-iosv-vagrant-libvirt

10. Run the Ansible playbook.

$ ansible-playbook main.yml

11. Copy (and rename) the Vagrant box artifact to the boxes directory.

$ cp cisco-iosv.box $HOME/boxes/cisco-iosv-159.box

12. Copy the box metadata file to the boxes directory.

$ cp ./files/cisco-iosv.json $HOME/boxes/

13. Change the current working directory to boxes.

$ cd $HOME/boxes

14. Substitute the HOME placeholder string in the box metadata file.

$ awk '/url/{gsub(/^ */,"");print}' cisco-iosv.json
"url": "file://HOME/boxes/cisco-iosv-159.box"

$ sed -i "s|HOME|${HOME}|" cisco-iosv.json

$ awk '/url/{gsub(/^ */,"");print}' cisco-iosv.json
"url": "file:///home/marc/boxes/cisco-iosv-159.box"

15. Add the Vagrant box to the local inventory.

$ vagrant box add cisco-iosv.json

Debug

View the telnet session output for the expect task:

$ tail -f ~/iosv-console.explog

License

This project is licensed under the MIT License - see the LICENSE file for details

cisco-iosv-vagrant-libvirt's People

Contributors

mweisel avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jbaznik

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.