summaryrefslogtreecommitdiff
path: root/others/vm3/docs
diff options
context:
space:
mode:
Diffstat (limited to 'others/vm3/docs')
-rw-r--r--others/vm3/docs121
1 files changed, 0 insertions, 121 deletions
diff --git a/others/vm3/docs b/others/vm3/docs
deleted file mode 100644
index eea91d1..0000000
--- a/others/vm3/docs
+++ /dev/null
@@ -1,121 +0,0 @@
1
2todo
3 make theseediso cloud init stuff happen inside the vm storage directory so that multiple poeple can use it ast the same time on the same system
4 fedora debian freebsd opensuse
5 change deployment for non-fedora to manually make a base image and copy ssh stuff over, then duplicate it however you want
6
7
8
9vm 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
10 # fedora not available. available os: listed down
11 # storage not available. please create it
12 # nw3 not available. create y/n?
13vm network create <name> 192.168.100.1 /32
14vm network create <name> (auto)
15vm storage create <name> /dev/
16vm storage create <name2> /dir/
17
18
19vm/
20 ./vm.sh # Single entry point. one vm at a time(except for compute delete-all)
21 .config/ # all config files
22 init/ # run this everytime. try to think of a way to set a flag that says this device has been initialised
23 install_packages.sh
24 make_rootkey.sh # in /root/k/k1. can also add keys in here
25 /var/lib/libvirt/images/.image_store/ # stores the images
26 /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
27 image/ # vm cloud init templates to make user-data, meta-data, and seed.iso
28 fedora.sh <vm name> # images in /var/lib/libvirt/images/.image_store/ and in images/.temp
29 opensuse.sh
30 debian.sh
31 freebsd.sh
32 list-all-images.sh
33 compute/
34 create.sh
35 # default vcpu ram disk storage pool network
36 # allow specification of storage pool and network.
37 # auto list all available images, storage pools, networks. on no argument. just call stroage/network list.sh
38 delete.sh and all associated virtual machines and block devices on all storage device
39 start.sh before starting the vm, make sure the cloud init seed.iso is not attached anymore.
40 shutdown.sh
41 list.sh # list by (sorted by) network group, ip address, then cpu ram disk, total disk(incl all attachedvols), name
42 network/
43 attach.sh # one click, so if vm is running, ask fro permission to shutdown. or if can, live attach
44 list.sh
45 detach.sh
46 create.sh # allow specifying the ip address range. auto make uuid
47 delete.sh
48 disk/
49 attach.sh
50 detach.sh
51 create.sh
52 list all available storage hardware devices on no argument. just call list.sh
53 make directory linking from /var/lib/libvirt/images/${VM_NAME}-vm-disks/ to the actual storage device
54 delete.sh
55 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
56 list.sh #list storage pools and include --all to view all blocks and their sizes
57 device/
58 usb/
59 attach.sh
60 detach.sh
61 view.sh # usbs of all the vms
62
63# No arguments shows available options
64./vm compute create
65Available networks:
66 prod-net 192.168.1.0/24
67 dev-net 192.168.2.0/24
68 test-net 192.168.3.0/24
69
70Available storage pools:
71 prod-store 2TB free
72 dev-store 500GB free
73 backup 1TB free
74
75Available images:
76 fedora40(41)
77
78
79Usage: ./vm compute create <name> <os> --vcpu 4 --ram 8 --disk 40 --storage-pool prod-store --network prod-net
80
81# Then use directly
82./vm compute create myvm fedora40 prod-net prod-store
83
84
85
86os
87 debian functionally works, and issues are primarily quality of life issues
88 Debian primarily uses /etc/bash.bashrc, move the colour to this instead of etc bashrc on fedora
89 change the localhost to name of the vm in the config app
90
91
92 freebsd have not tried editing root password, boots on generic cloud image, no login yet
93 ubuntu no boot no login yet.
94
95others
96 ssh
97 public ssh port like online vps
98 this forwards 2222 on the host to port 22
99 # 1. First, check your VM's IP address (from inside the VM)
100 ip addr show
101 # 2. Set up port forwarding in libvirt
102 virsh net-list # List networks
103 virsh net-edit default # Edit default network config
104 # Add this inside the <network> section:
105 <forward mode='nat'>
106 <nat>
107 <port start='2222' end='2222'>
108 <protocol>tcp</protocol>
109 <forward address='192.168.122.x' port='22'/> # Replace x with your VM's last octet
110 </port>
111 </nat>
112 </forward>
113 # 3. Restart the network
114 virsh net-destroy default
115 virsh net-start default
116 # 4. Configure firewall on Fedora host
117 sudo firewall-cmd --add-port=2222/tcp --permanent
118 sudo firewall-cmd --reload
119 seed.iso
120 move seed.iso to images/vmname/seed.iso
121 allows concurrent usage of vm.sh as there will be no conflicts