Skip links

fallocate: Operation not supported

The VSP Install Guide makes a best-practice recommendation to use the fallocate command on a Linux hypervisor when copying the qcow2 image file. fallocate will tell the file system on the hypervisor to pre-allocate disk space for the file, preventing a potential out-of-space error as the qcow2 grows. The Install Guide recommends that we use 285 GB for each VSD image. MetroAE automatically does the fallocate for you during vsd_predeploy.

We recently saw a case where the user was trying to install a VSD on a CentOS 7.2 hypervisor.  At thefallocate step, they saw this:

TASK [vsd-predeploy : Preallocate most of VSD disk space to avoid 
pausing the VM, this also checks disk space]
fatal: [vsd1.metro.net -> 10.0.1.10]: FAILED! => {"changed": true, 
"cmd": "fallocate -l 285G /home/metro/vsd1metro/VSD-5.3.3_99.qcow2", 
"delta": "0:00:00.005852", "end": "2018-12-14 05:31:53.606392", 
"failed": true, "msg": "non-zero return code", "rc": 1, 
"start": "2018-12-14 05:31:53.600540", "stderr": 
"fallocate: /home/metro/vsd1metro/VSD-5.3.3_99.qcow2: fallocate failed: Operation not supported", 
"stderr_lines": ["fallocate: /home/metro/vsd1metro/VSD-5.3.3_99.qcow2: fallocate failed: Operation not supported"], 
"stdout": "", "stdout_lines": []}

Upon further investigation, the user found the following in the fallocate manpage:

As  of the Linux Kernel v2.6.31, the fallocate system call is supported 
by the btrfs, ext4, ocfs2, and xfs filesystems.

The directory where the image file was to be copied was ext2. Reformatting the file system as ext4 allowed the installation to continue without error.

An alternative that can be used in non-production environments is to disable the fallocate step in MetroÆ. This can be accomplished by editing common.yml and setting the variable vsd_fallocate_size_gb to 0. When vsd_fallocate_size_gb is set to zero, the fallocate command will not run.

We *strongly* recommend that you disable the fallocate only for PoC.

Bitnami