Update statistics from computes if RBD ephemeral is used

Bug #1332660 reported by Andrey Grebennikov
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
Fix Released
High
MOS Nova
4.1.x
Won't Fix
High
MOS Nova
5.0.x
Fix Released
High
MOS Nova
5.1.x
Fix Released
High
MOS Nova
OpenStack Compute (nova)
Fix Released
Undecided
Dmitry Borodaenko

Bug Description

If we use RBD as the backend for ephemeral drives, compute nodes still calculate their available disk size looking back to the local disks.
This is the path how they do it:

* nova/compute/manager.py

    def update_available_resource(self, context):
        """See driver.get_available_resource()

        Periodic process that keeps that the compute host's understanding of
        resource availability and usage in sync with the underlying hypervisor.

        :param context: security context
        """
        new_resource_tracker_dict = {}
        nodenames = set(self.driver.get_available_nodes())
        for nodename in nodenames:
            rt = self._get_resource_tracker(nodename)
            rt.update_available_resource(context)
            new_resource_tracker_dict[nodename] = rt
....................
    def _get_resource_tracker(self, nodename):
        rt = self._resource_tracker_dict.get(nodename)
        if not rt:
            if not self.driver.node_is_available(nodename):
                raise exception.NovaException(
                        _("%s is not a valid node managed by this "
                          "compute host.") % nodename)

            rt = resource_tracker.ResourceTracker(self.host,
                                                  self.driver,
                                                  nodename)
            self._resource_tracker_dict[nodename] = rt
        return rt

* nova/compute/resource_tracker.py

    def update_available_resource(self, context):
        """Override in-memory calculations of compute node resource usage based
        on data audited from the hypervisor layer.

        Add in resource claims in progress to account for operations that have
        declared a need for resources, but not necessarily retrieved them from
        the hypervisor layer yet.
        """
        LOG.audit(_("Auditing locally available compute resources"))
        resources = self.driver.get_available_resource(self.nodename)

* nova/virt/libvirt/driver.py

    def get_local_gb_info():
        """Get local storage info of the compute node in GB.

        :returns: A dict containing:
             :total: How big the overall usable filesystem is (in gigabytes)
             :free: How much space is free (in gigabytes)
             :used: How much space is used (in gigabytes)
        """

        if CONF.libvirt_images_type == 'lvm':
            info = libvirt_utils.get_volume_group_info(
                                 CONF.libvirt_images_volume_group)
        else:
            info = libvirt_utils.get_fs_info(CONF.instances_path)

        for (k, v) in info.iteritems():
            info[k] = v / (1024 ** 3)

        return info

It would be nice to have something like "libvirt_utils.get_rbd_info" which could be used in case CONF.libvirt_images_type == 'rbd'

Tags: ceph nova
Changed in fuel:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Dmitry Borodaenko (dborodaenko)
milestone: none → 5.1
tags: added: ceph
Changed in fuel:
status: Confirmed → Triaged
Andrew Woodward (xarses)
summary: - Update statistics from computes if RBD is being used
+ Update statistics from computes if RBD ephmeral is used
Changed in fuel:
status: Triaged → Confirmed
status: Confirmed → Triaged
Changed in nova:
assignee: nobody → Dmitry Borodaenko (dborodaenko)
summary: - Update statistics from computes if RBD ephmeral is used
+ Update statistics from computes if RBD ephemeral is used
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/102064

Changed in nova:
status: New → In Progress
Revision history for this message
Dmitry Borodaenko (angdraug) wrote :

Attached the version of the patch for Havana, based on https://github.com/angdraug/nova/tree/rbd-live-migration-stable-havana

Changed in fuel:
status: Triaged → In Progress
Revision history for this message
Andrey Grebennikov (agrebennikov) wrote :

It does work for me.

Please check driver.py:
elif CONF.libvirt.images_type == 'rbd':
should be:
elif CONF.libvirt_images_type == 'rbd':

Thanks.

Revision history for this message
Dmitry Borodaenko (angdraug) wrote :
Revision history for this message
Dmitry Borodaenko (angdraug) wrote :
Changed in fuel:
assignee: Dmitry Borodaenko (dborodaenko) → MOS Nova (mos-nova)
Changed in mos:
status: New → In Progress
importance: Undecided → High
assignee: nobody → MOS Nova (mos-nova)
milestone: none → 5.1
tags: added: nova
Revision history for this message
Dmitry Borodaenko (angdraug) wrote :

Icehouse patch version from 6/24 was causing a regression (https://bugs.launchpad.net/mos/+bug/1335628), updated patch attached. Github branch already has the updated version of the patch.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/102064
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=9b559c31b781689fb66551f29a0cb8d10c7bac94
Submitter: Jenkins
Branch: master

commit 9b559c31b781689fb66551f29a0cb8d10c7bac94
Author: Dmitry Borodaenko <email address hidden>
Date: Mon Jun 23 16:12:18 2014 -0700

    Use Ceph cluster stats to report disk info on RBD

    Local disk statistics on compute nodes are irrelevant when ephemeral
    disks are stored in RBD. With RBD, local disk space is not consumed when
    instances are started on a compute node, yet it is possible for
    scheduler to refuse to schedule an instance when combined disk usage of
    instances already running on the node exceeds total disk capacity
    reported by the hypervisor driver.

    Change-Id: I9718c727db205b6f2191f8435583391584e96e6e
    Closes-bug: #1332660
    Signed-off-by: Dmitry Borodaenko <email address hidden>

Changed in nova:
status: In Progress → Fix Committed
Dmitry Pyzhov (dpyzhov)
no longer affects: fuel/5.1.x
Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-3
status: Fix Committed → Fix Released
no longer affects: fuel
no longer affects: fuel/4.1.x
no longer affects: fuel/5.0.x
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-3 → 2014.2
Revision history for this message
Alexander Gubanov (ogubanov) wrote :

I verified it on mos 5.1.1 - fixed

Changed in mos:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.