When configuring storage, it’s important to distinguish between Datacenter view and host view. For storage management, particularly for shared or external resources, the Datacenter view is the primary location.
Here are some key points regarding storage configuration within the Datacenter view:
- Thin Provisioning: This is a feature supported by
local-lvmstorage. - Linux Containers: The
rootfsfor containers must reside onlocal-lvm. - Linux VMs: For Linux VMs, ensure “discard” is enabled for their disks. You can manually trigger this with:
sudo fstrim -av- Windows VMs: For Windows VMs, run the following command in an administrative PowerShell:
defrag C: /oStorage Layout
For local storage, the default location is
/var/lib/vzThese are the files
./dump # VM/CT full backup
./images # VM/CT disks (.raw/.qcow2)
./template/cache # container templates
./template/iso # VM imagesExternal Drives
Config file
/etc/pve/storage.cfgSMB
Add
smbto the ID when adding SMB/CIFS drivesFor example, instead of
laptopserver, usesmb-laptopserver, so that the location will be ranked later thanlocaland `local-lvm
When creating a SMB/CIFS drive, add a subdirectory e.g. /pve
- such that PVE related folders will be placed in
./pve/dump|imageinstead at the root folder of the SMB drive
Resize VM Disk
Increase
On the VM Hardware, Disk Action > Resize
- add the size increment
Shutdown and start the VM
On the guest machine (Linux)
sudo parted /dev/sda- where
sdais the physical disk - use
printto check partitions, e.g.Numberand find the primary partition
resizepart 2 100%
- where
2is the main primary partition number above
sudo resize2fs /dev/sda2https://youtu.be/_u8qTN3cCnQ
If need to increase storage
- go to storage tab of datacenter
- delete the local-lvm
lvremove /dev/pve/datalvresize -l +100%FREE /dev/pve/root- `resize2fs /dev/mapper/pve-root