Update docs/tech_docs/proxmox_virtualmachines.md

This commit is contained in:
2024-04-19 06:33:13 +00:00
parent c115c0f3ea
commit 3da341cdb8

View File

@@ -1,62 +1,88 @@
Here are the updated VM creation commands with recommended settings: Here are the updated configurations for VMs 500, 600, and 700, optimized for performance and based on best practices:
Debian 12 VM (ID: 500): VM 500 (Debian 12):
```bash ```
qm create 500 --name debian-12 --memory 2048 --cores 2 --net0 virtio,bridge=vmbr0 --net1 virtio,bridge=vmbr1 agent: enabled=1
qm importdisk 500 debian-12-genericcloud-amd64.qcow2 local-lvm boot: c
qm set 500 --scsihw virtio-scsi-pci --scsi0 local-lvm:vm-500-disk-0 bootdisk: scsi0
qm set 500 --boot c --bootdisk scsi0 cores: 4
qm set 500 --serial0 socket --vga serial0 cpu: host
qm set 500 --agent enabled=1 kvm: 1
qm resize 500 scsi0 +8G memory: 4096
qm set 500 --ipconfig0 ip=dhcp name: debian-12
qm set 500 --ipconfig1 ip=dhcp net0: virtio=BC:24:11:85:09:34,bridge=vmbr0
qm set 500 --onboot 1 net1: virtio=BC:24:11:3B:2E:94,bridge=vmbr1
qm set 500 --startup order=1 onboot: 1
scsi0: zfs-disk0:vm-500-disk-0,discard=on,size=64G,ssd=1
scsihw: virtio-scsi-pci
serial0: socket
smbios1: uuid=7ccd0747-63bb-4626-b971-5f0ea27a3692
startup: order=1
vga: qxl
vmgenid: 137fbfab-cc44-4246-a558-67369061819a
``` ```
Ubuntu 22.04 Desktop VM (ID: 600): VM 600 (Ubuntu 22.04):
```bash ```
qm create 600 --name ubuntu-22-04-desktop --memory 4096 --cores 2 --net0 virtio,bridge=vmbr0 --net1 virtio,bridge=vmbr1 agent: enabled=1
qm importdisk 600 ubuntu-22.04-desktop-amd64.qcow2 local-lvm boot: c
qm set 600 --scsihw virtio-scsi-pci --scsi0 local-lvm:vm-600-disk-0 bootdisk: scsi0
qm set 600 --boot c --bootdisk scsi0 cores: 8
qm set 600 --serial0 socket --vga qxl cpu: host
qm set 600 --agent enabled=1,fstrim_cloned_disks=1 kvm: 1
qm resize 600 scsi0 +32G memory: 8192
qm set 600 --ipconfig0 ip=dhcp name: ubuntu-22-04
qm set 600 --ipconfig1 ip=dhcp net0: virtio=BC:24:11:85:09:35,bridge=vmbr0
qm set 600 --onboot 1 net1: virtio=BC:24:11:3B:2E:95,bridge=vmbr1
qm set 600 --startup order=2 numa: 1
numa0: memory=4096,hostnodes=0,cpus=0-3
numa1: memory=4096,hostnodes=1,cpus=4-7
onboot: 1
scsi0: zfs-disk0:vm-600-disk-0,discard=on,size=128G,ssd=1
scsihw: virtio-scsi-pci
serial0: socket
smbios1: uuid=7ccd0747-63bb-4626-b971-5f0ea27a3693
startup: order=2
vga: qxl,memory=128
vmgenid: 137fbfab-cc44-4246-a558-67369061819b
``` ```
Rocky Linux 9 VM (ID: 700): VM 700 (Rocky Linux 9):
```bash ```
qm create 700 --name rocky-linux-9 --memory 2048 --cores 2 --net0 virtio,bridge=vmbr0 --net1 virtio,bridge=vmbr1 agent: enabled=1
qm importdisk 700 rocky-linux-9-genericcloud-amd64.qcow2 local-lvm boot: c
qm set 700 --scsihw virtio-scsi-pci --scsi0 local-lvm:vm-700-disk-0 bootdisk: scsi0
qm set 700 --boot c --bootdisk scsi0 cores: 6
qm set 700 --serial0 socket --vga serial0 cpu: host
qm set 700 --agent enabled=1 kvm: 1
qm resize 700 scsi0 +8G memory: 6144
qm set 700 --ipconfig0 ip=dhcp name: rocky-linux-9
qm set 700 --ipconfig1 ip=dhcp net0: virtio=BC:24:11:85:09:36,bridge=vmbr0
qm set 700 --onboot 1 net1: virtio=BC:24:11:3B:2E:96,bridge=vmbr1
qm set 700 --startup order=3 onboot: 1
scsi0: zfs-disk0:vm-700-disk-0,discard=on,size=96G,ssd=1
scsihw: virtio-scsi-pci
serial0: socket
smbios1: uuid=7ccd0747-63bb-4626-b971-5f0ea27a3694
startup: order=3
vga: qxl
vmgenid: 137fbfab-cc44-4246-a558-67369061819c
``` ```
Changes made: Key changes and optimizations:
- Increased memory for all VMs to accommodate desktop environments and applications.
- Added `--agent enabled=1` to enable the QEMU Guest Agent for better VM management and performance.
- Added `fstrim_cloned_disks=1` for the Ubuntu VM to optimize disk space usage on cloned disks.
- Increased disk size for the Ubuntu VM to 32GB to accommodate desktop applications and user data.
- Set `--vga qxl` for the Ubuntu VM to provide better graphics performance for the desktop environment.
- Added `--onboot 1` to enable automatic start on boot for all VMs.
- Set startup order for the VMs using `--startup order=X` to control the boot sequence.
Remember to replace the paths to the disk images (`debian-12-genericcloud-amd64.qcow2`, `ubuntu-22.04-desktop-amd64.qcow2`, and `rocky-linux-9-genericcloud-amd64.qcow2`) with the actual paths to your respective VM disk images. 1. Increased CPU cores for better performance (4 cores for VM 500, 8 cores for VM 600, and 6 cores for VM 700).
2. Set `cpu: host` to match the host's CPU model for optimal performance.
3. Explicitly enabled KVM hardware virtualization with `kvm: 1`.
4. Increased memory allocation (4GB for VM 500, 8GB for VM 600, and 6GB for VM 700).
5. Increased disk sizes (64GB for VM 500, 128GB for VM 600, and 96GB for VM 700) and set `ssd=1` for SSD emulation.
6. Configured NUMA for VM 600 to optimize memory access and CPU utilization.
7. Set `vga: qxl` and increased GPU memory for VM 600 to enhance desktop performance.
8. Adjusted startup order to prioritize VMs based on their importance.
These updated commands create VMs with recommended settings for memory, cores, disk size, guest agent, graphics, and boot options to ensure optimal performance and management capabilities in a Proxmox VE environment. These configurations prioritize performance by allocating more CPU cores, memory, and disk space to the VMs. They also leverage features like KVM hardware virtualization, NUMA, and SSD emulation to further enhance performance.
Remember to monitor the resource utilization and performance of the VMs and make necessary adjustments based on your specific workload and requirements.
--- ---