Disk filter is not worked correct when the instance directory are shared - shidax/docs GitHub Wiki

Summary of the bug report.

https://bugs.launchpad.net/nova/+bug/1384546

And I check the following in master branch at 2015/02/24

commit 7ef2fbcf14f856dcd78e2182e0f433c90907d2f2
Merge: 614ffbb e4532ef
Author: Jenkins <[email protected]>
Date:   Tue Feb 24 06:29:54 2015 +0000

    Merge "Add useful debug logging when policy checks fail"

Behavior of default scheduler

In my evaluation environment, the OpenStack provide 34GB disk space. There are 2 hypervisors. One hypervisor has 17GB disk space.

environment

If we launch the new instance with 20GB disk. Can it launch or not?

default_behavior

In OpenStack default behavior, it does not block the launch instance for disk space reason. Although there are no space, launching the instance goes well.

Behavior of DiskFilter

DiskFilter - filters hosts by their disk allocation. Only hosts with sufficient disk space to host the instance are passed. disk_allocation_ratio setting. It’s virtual disk to physical disk allocation ratio and it’s 1.0 by default. The total allow allocated disk size will be physical disk multiplied this ratio.

If we use DiskFilter, it can block the over commit of disk space. Same operation as above, OpenStack says "No valid host"

disk_filter

In other words , DiskFilter are guaranteed to be available the disk of the size specified in the user.

DiskFilter can't treat the shared disk

If these compute nodes share their instance directory, DiskFilter can't calculate the free space correctly. Actually, 2 compute node share the disk with nfs.

Filesystem                                     Size  Used Avail Use% Mounted on
/dev/mapper/compute--vg-root                    18G  3.2G   14G  19% /
none                                           4.0K     0  4.0K   0% /sys/fs/cgroup
udev                                           985M  4.0K  985M   1% /dev
tmpfs                                          200M  668K  199M   1% /run
none                                           5.0M     0  5.0M   0% /run/lock
none                                           998M     0  998M   0% /run/shm
none                                           100M     0  100M   0% /run/user
/dev/sda1                                      236M   41M  183M  19% /boot
192.168.27.181:/opt/stack/data/nova/instances   18G  5.8G   11G  36% /opt/stack/data/nova/instances

Then, it can launch two instance with 10GB disk.

problem

OpenStack doesn't know about they share the disk.