Monday, January 9, 2012

OpenVZ vzctl Disk Quota exceeded error

I was creating some VM's on a new hardware node using the vzctl --create command, half way through the command I started getting Disk Quota exceeded error
Creating container private area (centos-5-x86_64)
tar: ./usr/lib64/mono/1.0/mcs.exe: Cannot write: Disk quota exceeded
tar: Skipping to next header
tar: Archive contains obsolescent base-64 headers
tar: ./usr/lib64/mono/1.0/setreg.exe.mdb: Cannot write: Disk quota exceeded
tar: Skipping to next header
tar: ./usr/lib64/mono/1.0/mozroots.exe.mdb: Cannot write: Disk quota exceeded
There were also error messages in /var/log/messages
Jan 7 09:48:51 server kernel: VZ QUOTA: disk softlimit exceeded for id=111
Jan 7 09:48:54 server kernel: VZ QUOTA: disk hardlimit reached for id=111
Inspite of lot of googling, there was not much that I could use to troubleshoot, I checked to see if there are disk quota's enabled on the disk, but found none.

After a little looking around and poking I found that I had used vzsplit to create a template configuration file. I passed -n 32 to vzsplit on a disk worth 150G. As a result vzsplit split 150G into 32 parts and set the DISKSPACE parameter very low. Thus during VM creation as the image was being untared, the low disk limit was being reached and vzctl started to complain about disk limit reached.
I was using the 150G disk for the OS, and the plan was to use other secondary disks for the VM root and private area.

This unveiled another thing about vzsplit, that while splitting resources it only considers the disk that has the OS installed on it, and ignores all other secondary disks attached to the server.

To continue creating the VM's I manually edited the DISKSPACE parameter set in the file generated by vzsplit to some high value and the --create command completed successfully.

No comments:

Post a Comment