https://github.com/rktjmp/virt-up
https://github.com/rktjmp/virt-up
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rktjmp/virt-up
- Owner: rktjmp
- Created: 2022-09-03T10:31:11.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-04T15:33:41.000Z (about 3 years ago)
- Last Synced: 2025-01-27T08:24:48.111Z (8 months ago)
- Language: Shell
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# virt-up
A small script automate booting a set of virtual machines with an attached
cloud-init image.# Requirements
- libvirt
- genisoimage
- qemu-imag
- a qcow base image to boot# Usage
1. Edit `cloud-init/meta-data` and `cloud-init/user-data` as desired.
2. Create a symbolic link from `base.qcow2` to your distributions cloud/nocloud
qcow2 image.
3. Launch the VMs with:
- `./virt-up.sh --named app db ingress` for "named" instances. `libvirt`
should automatically make these machines available by the names given (so
`ping app` should work). You can also use `-w` (w for "words").
- `./virt-up.sh --number 3` to launch 3 machines with randomised
alpha-numeric names.
4. Wait for the machines to spin up, it can take some time for the network
interfaces to come online.
5. Press enter to automatically tear down and delete the VMs.# Trouble shooting
Make sure you've started libvirt and the default network before use:
```
sudo systemctl start libvirtd
sudo virsh net-start default
```You may need to configure nss for hostname resolution:
- https://libvirt.org/nss.html
Hostnames should be only alpha-numeric, probably. See `sudo virsh net-dhcp-leases
default` for actual hostnames. `vm_host` may be rewritten to `vmhost`.