Package: topology-deployer
topology-deployerPython tool to deploy topologies on Ubuntu from the defined json config files.Table of ContentsPrerequisitesUser GuideCreate TopologyDelete TopologyVerbosityJSON Topology ConfigJSON Network ConfigJSON Virtual Machine ConfigPrerequisitesRun./installUser GuideInstallationInstall from Python Package Indexsudo pip3 install topology-deployerTo install from sourcesudo pip3 install .OptionsParse topology configoptional arguments:
  -h, --help            show this help message and exit
  -c CONFIG, --config CONFIG
                        JSON Config file that defines the topology
  -o {create,delete,CREATE,DELETE}, --operation {create,delete,CREATE,DELETE}
                        Operation to create or delete topology from the JSON Config
  -i {ubuntu,rocky}, --image {ubuntu,rocky}
                        Choose the base OS image for the VMS
  -l {DEBUG,INFO,WARNING,ERROR,CRITICAL}, --log {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Set the log level
  --dry-run             Instead of executing, print the commands
  --skip-network        Skip creating networks. Cannot be used with --skip-vm
  --skip-vm             Skip creating vms. Cannot be used with --skip-networkCreating TopologiesA JSON cofig is taken as input. Checkherefor guide to define configsudo topology-deployer -c config.json -o create -i ubuntu -l INFOTo skip creating networks. It can be used woth delete too. (This isBETAfeature. Not fully tested)sudo topology-deployer -c config.json -o create -i ubuntu -l INFO --skip-networkTo skip creating virtual machines. It can be used woth delete too. (This isBETAfeature. Not fully tested)sudo topology-deployer -c config.json -o create -i ubuntu -l INFO --skip-vmDeleting TopologiesSame JSON cofig used to create topology is taken as input.sudo topology-deployer -c config.json -o delete -l INFOVerbosityTo print verbose output for created networkssudo topology-deployer --print-nw -c config.json -o createTo print verbose output for created virtual machinessudo topology-deployer --print-vm -c config.json -o createJSON ConfigThe json config to define topologies comprises of 2 sections.NetworksVirtual Machines{"version":2,"networks":[],"vms":[]}JSON Network ConfigThe JSON network object comprises of array of networks. A network object skeleton is shown below{"networks":[{"name":"<name>","type":"<nat | management | isolated>","subnet4":"<ipv4 subnet>","subnet6":"<ipv6 subnet>"}],}Add NAT network in JSON network objectFor nat network,nameandsubnet4are mandatory fields.subnet6is optional in case you need v6 network in your topology. To have multiple NAT networks, you can add multiple objects in the networks.nat json object.{"networks":[{"name":"<name>","type":"nat","subnet4":"<ipv4 subnet>","subnet6":"<ipv6 subnet>"}]}Add Management network in JSON network objectFor management network,nameandsubnet4are mandatory fields. Currently we do not support v6 management network. To have multiple NAT networks, you can add multiple objects in the networks.management json object.{"networks":[{"name":"<name>","type":"management","subnet4":"<ipv4 subnet>"}]}Add Isolated network in JSON network objectFor isolated network,nameis mandatory fields. To have multiple NAT networks, you can add multiple objects in the networks.isolated json object.{"networks":[{"name":"<name>","type":"management"}]}JSON Virtual Machine ConfigThe vms object is array of multiple vm objects. For the vm object on the JSON config,name,flavor,vnc_portandnetworksare mandatory fields. You can optionally useram,vcpusanddiskto override the defaults for the flavor. A vms object skeleton is shown below{"vms":[{"name":"","flavor":"","vnc_port":"","networks":{"<nw_name1>":{"v4":""},"<nw_name2>":{"v4":"","v6":""}}}]}To define networks for the vm, you have to use the network name as key and providev4address. You can also add av6address if the network type is NAT.If you want to customize the resources for your VM you can use thevcpus,ramanddiskkeys. Example{"vms":[{"name":"","flavor":"","vcpus":10,"ram":8192,"disk":"128G","vnc_port":"","networks":{"<nw_name1>":{"v4":""},"<nw_name2>":{"v4":"","v6":""}}}]}Sample Topology Configurations2PE-CE2PE-2PSWITCH-2CE