Physical Volume - How much free space for snapshots/backups of OpenVZ

jompsi

Active Member
Apr 15, 2013
33
0
26
Hi all

I have two Harddisks in my proxmox server. On the first hd is proxmox installed. Now what I did for my second HD:
Code:
pvcreate /dev/sdb1
vgcreate local /dev/sdb1
lvcreate -n name -l 100%FREE local

But when I try to create an OpenVZ backup I get Exit Code 5. I found out, that this is because the physical volume has no free space for snapshots. My question ist, how much free space needs the physical volume for creating OpenVZ backups. How much space do you allocate for snapshots? What is a good value?

The size of the hd is 278 GB.

Regards
jompsi
 
Hello jompsi,

I have two Harddisks in my proxmox server. On the first hd is proxmox installed. Now what I did for my second HD:
Code:
pvcreate /dev/sdb1
vgcreate local /dev/sdb1
lvcreate -n name -l 100%FREE local

Didn´t you create a filesystem in /dev/local/name mount it and define it then as local storage?

I the problem occurs even all this has been done correctly post /etc/pve/storage.cfg and the content of "Task Viewer:Backup" for detailed analysis.



Kind regards

Mr.Holmes
 
Hi Mr.Holmes

Yes, I created a filesystem like this:
Code:
mkfs.ext4 /dev/daxter-local/daxter-local
mkdir /mnt/daxter-local
mount /dev/daxter-local/daxter-local /mnt/daxter-local/

And than I defined it as a local storage.

storage.cfg:
Code:
dir: daxter-local
        path /mnt/daxter-local
        content images,iso,vztmpl,backup,rootdir
        maxfiles 1

Task Viewer: Backup
Code:
[COLOR=#000000][FONT=tahoma]INFO: starting new backup job: vzdump 300 --remove 0 --mode snapshot --compress lzo --storage cube-temp-bkp-nfs --node daxter[/FONT][/COLOR]
[COLOR=#000000][FONT=tahoma]INFO: Starting Backup of VM 300 (openvz)[/FONT][/COLOR]
[COLOR=#000000][FONT=tahoma]INFO: CTID 300 exist mounted running[/FONT][/COLOR]
[COLOR=#000000][FONT=tahoma]INFO: status = running[/FONT][/COLOR]
[COLOR=#000000][FONT=tahoma]INFO: backup mode: snapshot[/FONT][/COLOR]
[COLOR=#000000][FONT=tahoma]INFO: ionice priority: 7[/FONT][/COLOR]
[COLOR=#000000][FONT=tahoma]INFO: creating lvm snapshot of /dev/mapper/daxter--local-daxter--local ('/dev/daxter-local/vzsnap-daxter-0')[/FONT][/COLOR]
[COLOR=#000000][FONT=tahoma]INFO:   Volume group "daxter-local" has insufficient free space (0 extents): 256 required.[/FONT][/COLOR]
[COLOR=#000000][FONT=tahoma]ERROR: Backup of VM 300 failed - command 'lvcreate --size 1024M --snapshot --name vzsnap-daxter-0 /dev/daxter-local/daxter-local' failed: exit code 5[/FONT][/COLOR]
[COLOR=#000000][FONT=tahoma]INFO: Backup job finished with errors[/FONT][/COLOR]
[COLOR=#000000][FONT=tahoma]TASK ERROR: job errors[/FONT][/COLOR]

I think I cant use 100% space from the physical volume. I need to let some space free, for the snapshots.

Thanks and regards
jompsi
 
As far as I remember, if you want to do snapshot backup you need free space in the VG, and you have none. Best practice is to have 1 or 5 GB for that, depending on how much I/O your VM does while is being backed up.
 
First, I'm not a LVM expert, so take my advices as just "suggestions" and find the right way to implement them.
The situation is:
you need to obtain something like:
# vgs
VG #PV #LV #SN Attr VSize VFree
pve 2 3 0 wz--n- 111,49G 5,99G

where there are 5-6GB of free space in the volume group, so the logical volume in it does not fill all the space.
To reduce the LV you should unmount and reduce the filesystem on it first (more than the free space you need, just to be sure), then use lvreduce or lvresize (like lvresize --size 100G /dev/pve/data) and then expand the filesystem to fill all the (new) space.
Maybe you'd better take backup of your vm, remove and recreate the LV with a size like VG size-4GB, format it with ext3 or 4, edit fstab and remount and restore vms.
Don't know if Gparted can resize LV too (I use it, booting from systemrescuecd, to resize the partitions and fs inside vms).
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!