https://github.com/artemtech/vmcreator
python implementation of libvirtd vm creator + cloudinit
https://github.com/artemtech/vmcreator
Last synced: 7 months ago
JSON representation
python implementation of libvirtd vm creator + cloudinit
- Host: GitHub
- URL: https://github.com/artemtech/vmcreator
- Owner: artemtech
- Created: 2023-06-26T10:07:03.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-12-23T03:44:50.000Z (over 2 years ago)
- Last Synced: 2025-01-01T13:41:59.331Z (over 1 year ago)
- Language: Python
- Size: 59.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
VM Creator using KVM (libvirt)
===
This is one of my python coding journey in infras project, inspired by [terraform libvirt provider](https://github.com/dmacvicar/terraform-provider-libvirt).
The flows are follow:
```
supply config.yaml -> vmcreator.py -> launched vm
```
Development
===
This script were compiled on top of Arch Linux, python 3.10, libvirt 1:8.10.0-1, cdrtools (genisoimage) 3.02a09-5, qemu-img 7.2.0-1
preqs:
- genisoimage
- qemu-img
- libvirt-python
- lxml
- pyyaml
installing:
```bash
git clone https://github.com/artemtech/vmcreator
cd vmcreator
#----------------------------
# global install
sudo pip3 install .
#----------------------------
# install for current user only
pip3 install .
export PATH="~/.local/bin:$PATH"
#----------------------------
```
Usage
===
```bash
vmcreator --help
```
- install (deploying) new vm
```bash
vmcreator -c config.yaml install
```
- update
```bash
tbd
```
- destroy
```bash
vmcreator -c config.yaml destroy
# if with storage
vmcreator -c config.yaml destroy --delete-storage
# if with network
vmcreator -c config.yaml destroy --delete-network
# destroy all
vmcreator -c config.yaml destroy --delete-storage --delete-network
```