1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
vm compute create name1 -os fedora -vcpu 1 -ram 1 -disk 10 -s.pool storage1 -add-disk 200 storage2 -add-network nw3 # default fedora 4,4,20
# fedora not available. available os: listed down
# storage not available. please create it
# nw3 not available. create y/n?
vm network create <name> 192.168.100.1 /32
vm network create <name> (auto)
vm storage create <name> /dev/
vm storage create <name2> /dir/
vm/
./vm.sh # Single entry point. one vm at a time(except for compute delete-all)
.config/ # all config files
init/ # run this everytime. try to think of a way to set a flag that says this device has been initialised
install_packages.sh
make_rootkey.sh # in /root/k/k1. can also add keys in here
/var/lib/libvirt/images/.image_store/ # stores the images
/var/lib/libvirt/images/.temp/ # for user-data, meta-data, and seed.iso(has ud and md inside) need to delete after initialising a new vm
image/ # vm cloud init templates to make user-data, meta-data, and seed.iso
fedora.sh <vm name> # images in /var/lib/libvirt/images/.image_store/ and in images/.temp
opensuse.sh
debian.sh
freebsd.sh
list-all-images.sh
compute/
create.sh
# default vcpu ram disk storage pool network
# allow specification of storage pool and network.
# auto list all available images, storage pools, networks. on no argument. just call stroage/network list.sh
delete.sh and all associated virtual machines and block devices on all storage device
start.sh before starting the vm, make sure the cloud init seed.iso is not attached anymore.
shutdown.sh
list.sh # list by (sorted by) network group, ip address, then cpu ram disk, total disk(incl all attachedvols), name
network/
attach.sh # one click, so if vm is running, ask fro permission to shutdown. or if can, live attach
list.sh
detach.sh
create.sh # allow specifying the ip address range. auto make uuid
delete.sh
disk/
attach.sh
detach.sh
create.sh
list all available storage hardware devices on no argument. just call list.sh
make directory linking from /var/lib/libvirt/images/${VM_NAME}-vm-disks/ to the actual storage device
delete.sh
delete all blocks. all the linking if can. may not be able to link like that idk. list all mounts and delete the originla and the links
list.sh #list storage pools and include --all to view all blocks and their sizes
device/
usb/
attach.sh
detach.sh
view.sh # usbs of all the vms
# No arguments shows available options
./vm compute create
Available networks:
prod-net 192.168.1.0/24
dev-net 192.168.2.0/24
test-net 192.168.3.0/24
Available storage pools:
prod-store 2TB free
dev-store 500GB free
backup 1TB free
Available images:
fedora40(41)
Usage: ./vm compute create <name> <os> --vcpu 4 --ram 8 --disk 40 --storage-pool prod-store --network prod-net
# Then use directly
./vm compute create myvm fedora 2 4 20 prod-net prod-store
|