cloudvirt
Project description
cloudvirt
cloudvirt creates and destroys cloud-init powered x86_64 VMs using the libVirt API.
installation
1. stable
pip install cloudvirt
2. dev
git clone --depth=1 https://github.com/gottaeat/cloudvirt
cd cloudvirt/
pip install .
configuration
specification
domains
| key | necessity | description |
|---|---|---|
| dom_name | required | str name of the domain |
| dom_mem | required | int amount of memory in megabytes |
| dom_vcpu | required | int core count |
| net | required | str name of the libVirt network to associate with the VM |
| isolated_port | optional | bool whether port is isolated. If unset, relevant config not emitted. |
| vol_pool | required | str name of the libVirt pool to associate with the VM |
| vol_size | required | int disk size in gigabytes |
| base_image | optional | str full name of the cloud-init capable cloud image[1] |
| ip | check[2] | ipv4 ipv4 address or network to be associated with the primary interface of the VM |
| sshpwauth | optional | bool whether to allow ssh authentication via passwords (VM-wide, applies to all users) |
| gateway | check[3] | ipv4 the next hop to the default route |
[1] the cloud image specified must be present in the specified volume pool
and be reachable by libVirt before cloudvirt is executed. if none provided,
noble-server-cloudimg-amd64.img is expected to be present.
[2] if specified without a /, an attempt at DHCP and DNS reservation will
be made. specifying a gateway makes providing a value for this key in CIDR
notation necessary.
if there is no /, this address must be within the DHCP range of the libVirt
network specified.
[3] installed as on-link. specifying this makes an ip to be supplied in
CIDR notation necessary.
[2+3] these keys must be supplied with a value that abides by the
requirements stated above if the network type for the specified libVirt network
is not one of: router, nat
users
| key | necessity | description |
|---|---|---|
| name | required | str name of the user |
| password_hash | optional | str password hash in shadow compliant crypt() format (like mkuser output) |
| ssh_keys | optional | list of str list of ssh keys to append to the authorized_keys of the user |
| sudo_god_mode | required | bool toggle for adding the user to the sudo group and allowing it to run sudo without a password |
WARNING: if you do not specify any authentication method in the file
supplied via --users and if you:
- do not specify an arbitrary
user-datafile via--userdata, - or, specify a
user-databut the resulting finalcloud-inituser-datayaml to be written to the iso ends up having no valid authentication method
program will halt.
examples
--users <userspec.yml>
you can also do cloudvirt mkuser to interactively generate a userspec.yml
through prompts.
---
userspec:
- name: john
password_hash: '$y$j9T$/gPg8H0fdtuZh8Ja8decf.$f7IzP89gNaToHUsY2bdgaxv2HJsKSRYLyG6mxNZ6AW3'
sudo_god_mode: true
- name: doe
ssh_keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI0000000000000000000000000000000000000000000
<vmspec.yml>
---
vmspec:
dom_name: cloudvirttest
dom_mem: 2048
dom_vcpu: 2
net: cloudvirt
# isolated_port: no
# ip:
# gateway:
vol_pool: cloudvirt
vol_size: 10
# base_image:
# sshpwauth:
<pool.xml>
<pool type="dir">
<name>cloudvirt</name>
<target>
<path>/pools/cloudvirt</path>
</target>
</pool>
<net.xml>
<network>
<name>cloudvirt</name>
<forward mode="nat"/>
<ip address="192.168.253.1" netmask="255.255.255.0">
<dhcp>
<range start="192.168.253.1" end="192.168.253.254"/>
</dhcp>
</ip>
</network>
usage
cloudvirt --help
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cloudvirt-0.1.4.tar.gz.
File metadata
- Download URL: cloudvirt-0.1.4.tar.gz
- Upload date:
- Size: 27.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8b7fed68a00a649e6c341a7b616ce0e5f73b797334ccbbe6ee1a7f229899e83
|
|
| MD5 |
6de2154c3ed0bfa1cfafdb6e2671441a
|
|
| BLAKE2b-256 |
3b21badc1135439d868c6dd7bf0eb0127cf71e113840da0665e7c8d084e2301a
|
Provenance
The following attestation bundles were made for cloudvirt-0.1.4.tar.gz:
Publisher:
pypi.yml on gottaeat/cloudvirt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cloudvirt-0.1.4.tar.gz -
Subject digest:
c8b7fed68a00a649e6c341a7b616ce0e5f73b797334ccbbe6ee1a7f229899e83 - Sigstore transparency entry: 362959980
- Sigstore integration time:
-
Permalink:
gottaeat/cloudvirt@bfe744dd528a456ede1b561a2a55fa4e01d4e4db -
Branch / Tag:
refs/tags/0.1.4 - Owner: https://github.com/gottaeat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@bfe744dd528a456ede1b561a2a55fa4e01d4e4db -
Trigger Event:
release
-
Statement type:
File details
Details for the file cloudvirt-0.1.4-py2.py3-none-any.whl.
File metadata
- Download URL: cloudvirt-0.1.4-py2.py3-none-any.whl
- Upload date:
- Size: 28.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3732d76d2a0ec947b830f6c3414f3e4f45b4fdc01a8f1157e66b92e837d8fb54
|
|
| MD5 |
6770f8cf39dc4397715c0a56073f4739
|
|
| BLAKE2b-256 |
4b3934cc7fc2f8e6bc790417358ccfde0018e483f60f264dfb56ea2a890da202
|
Provenance
The following attestation bundles were made for cloudvirt-0.1.4-py2.py3-none-any.whl:
Publisher:
pypi.yml on gottaeat/cloudvirt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cloudvirt-0.1.4-py2.py3-none-any.whl -
Subject digest:
3732d76d2a0ec947b830f6c3414f3e4f45b4fdc01a8f1157e66b92e837d8fb54 - Sigstore transparency entry: 362959986
- Sigstore integration time:
-
Permalink:
gottaeat/cloudvirt@bfe744dd528a456ede1b561a2a55fa4e01d4e4db -
Branch / Tag:
refs/tags/0.1.4 - Owner: https://github.com/gottaeat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@bfe744dd528a456ede1b561a2a55fa4e01d4e4db -
Trigger Event:
release
-
Statement type: