
qemu-img create -f qcow2 /vm/sys/windows/win-server-2022-template-sys.qcow2 60G


virt-install \
  --name win-server-2022-template \
  --virt-type kvm \
  --machine q35 \
  --vcpus 8 \
  --ram 16384 \
  --cpu mode=host-passthrough \
  --os-variant win10 \
  --disk path=/vm/sys/windows/win-server-2022-template-sys.qcow2,format=qcow2,bus=sata,cache=none,discard=unmap \
  --cdrom /vm/data/iso/windows-server-2022.iso \
  --disk path=/vm/data/iso/virtio-win-0.1.285.iso,device=cdrom,bus=sata,readonly=on \
  --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 win-server-2022-template
virsh domstate win-server-2022-template

virsh dumpxml --inactive win-server-2022-template > /root/win-server-2022-template.xml

virsh edit win-server-2022-template

virsh start win-server-2022-template


virsh destroy win-server-2022-template

python3 vm_manager.py clone-windows \
  --template win-server-2022-template \
  --name ws2022-192-168-11-160 \
  --ip 192.168.11.160
