Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gitkaz/kvm_port_switcher


https://github.com/gitkaz/kvm_port_switcher

Last synced: 10 days ago
JSON representation

Awesome Lists containing this project

README

        

# kvm_port_switcher

## Demo Animation
![result](https://github.com/gitkaz/kvm_port_switcher/blob/media/interactive_mode_demo.gif)

## What is this?
This is a Python Script for view and modify KVM guest (domain)'s interface configuration.
This scirpt is able to use either one-shot execution(normal cli command), and continuous interactive interface.

## Limitations.
Server (libvirtd host) should use KVM. And domain interface configuration should based on portgroup.
Like this.
```




```
This script can change "**source**" element's attributes(**network** and **portgroup**, only).

## usage
- one-shot execute and get domain and interface list.
- kvm_port_switcher -c "libvirt uri"
- one-shot execute and get network and porgroup list.
- kvm_port_switcher -c "libvirt uri" -n
- one-shot execute and change domain's interfe's network and portgoroup.
- kvm_port_switcher -c "libvirt uri" --set -i -p
- interactive mode.
- kvm_port_switcher -c "libvirt uri" -I

## help
```
usage: kvm_port_switcher.py [-h] -c CONNECT [-I] [-d] [-n] [-s] [-i INTERFACE]
[-p PORTGROUP] [--dry]

KVM virtual machine interface switcher

optional arguments:
-h, --help show this help message and exit
-c CONNECT, --connect CONNECT
Hypervisor(libvirtd) connection URI. always required.
-I, --Interactive Enable interactive mode
-d, --domain Show domain(virtual machine) and network insterface
list of connected hypervisor
-n, --network Show network and portrgoup list of connected
hypervisor
-s, --set Set mode. This mode configure your hypervisor
configuration. use with -i, -p and --dry.
-i INTERFACE, --interface INTERFACE
Specify modify interface by number
-p PORTGROUP, --portgroup PORTGROUP
Specify target portgroup by number
--dry Don't update real configuration. Just display before
and after Interface XML
```