大量更新
This commit is contained in:
58
997-项目VPN虚拟机/3-ubuntu2204虚拟机模板.sh
Normal file
58
997-项目VPN虚拟机/3-ubuntu2204虚拟机模板.sh
Normal file
@@ -0,0 +1,58 @@
|
||||
|
||||
qemu-img create -f qcow2 /vm/sys/linux/ubuntu2204-vm-sys.qcow2 30G
|
||||
|
||||
|
||||
virt-install \
|
||||
--name ubuntu2204-vm \
|
||||
--virt-type kvm \
|
||||
--machine q35 \
|
||||
--vcpus 8 \
|
||||
--ram 16384 \
|
||||
--cpu mode=host-passthrough \
|
||||
--os-variant ubuntu21.04 \
|
||||
--disk path=/vm/sys/ubuntu2204-vm-sys.qcow2,format=qcow2,bus=sata,cache=none,discard=unmap \
|
||||
--network bridge=br0,model=virtio \
|
||||
--graphics vnc,listen=127.0.0.1 \
|
||||
--video vga \
|
||||
--channel unix,target_type=virtio,name=org.qemu.guest_agent.0 \
|
||||
--sound none \
|
||||
--noautoconsole \
|
||||
--autostart
|
||||
|
||||
|
||||
virsh shutdown ubuntu2204-vm
|
||||
virsh domstate ubuntu2204-vm
|
||||
|
||||
virsh dumpxml --inactive ubuntu2204-vm > /root/ubuntu2204-vm.xml
|
||||
|
||||
virsh edit ubuntu2204-vm
|
||||
|
||||
virsh start ubuntu2204-vm
|
||||
|
||||
|
||||
virsh destroy ubuntu2204-vm
|
||||
|
||||
|
||||
python3 vm_manager.py clone-linux \
|
||||
--template ubuntu2204-vm\
|
||||
--name-prefix ubuntu2204 \
|
||||
--ip 192.168.11.170 \
|
||||
--prefix 24 \
|
||||
--gateway 192.168.11.1 \
|
||||
--dns 192.168.34.40,223.5.5.5 \
|
||||
--vcpus 4 \
|
||||
--memory 8192 \
|
||||
--data-size 300G \
|
||||
--autostart
|
||||
|
||||
python3 vm_manager.py clone-linux \
|
||||
--template ubuntu2204-vm\
|
||||
--name-prefix ubuntu2204 \
|
||||
--ip 192.168.11.226 \
|
||||
--prefix 24 \
|
||||
--gateway 192.168.11.1 \
|
||||
--dns 192.168.34.40,223.5.5.5 \
|
||||
--vcpus 4 \
|
||||
--memory 8192 \
|
||||
--data-size 300G \
|
||||
--autostart
|
||||
Reference in New Issue
Block a user