free_disk_gb is not correctly, because swap disk size is not minus.

Bug #1615903 reported by Charlotte Han
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Undecided
Rajesh Tailor

Bug Description

1. code in compute/resource_tracker.py

def _update_usage(self, usage, sign=1):
        mem_usage = usage['memory_mb']
        disk_usage = usage.get('root_gb', 0)

        overhead = self.driver.estimate_instance_overhead(usage)
        mem_usage += overhead['memory_mb']
        disk_usage += overhead.get('disk_gb', 0)

        self.compute_node.memory_mb_used += sign * mem_usage
        self.compute_node.local_gb_used += sign * disk_usage
        self.compute_node.local_gb_used += sign * usage.get('ephemeral_gb', 0)
        self.compute_node.vcpus_used += sign * usage.get('vcpus', 0)

        # free ram and disk may be negative, depending on policy:
        self.compute_node.free_ram_mb = (self.compute_node.memory_mb -
                                         self.compute_node.memory_mb_used)
        self.compute_node.free_disk_gb = (self.compute_node.local_gb -
                                          self.compute_node.local_gb_used)

        self.compute_node.running_vms = self.stats.num_instances

2. So I think self.compute_node.local_gb_used is contained swap disk size. And free_disk_gb is not minus swap disk size.

Rajesh Tailor (ratailor)
Changed in nova:
assignee: nobody → Rajesh Tailor (ratailor)
Revision history for this message
Maciej Szankin (mszankin) wrote :

Swap partition is a disk space that is not available for storing any kind of data other than memory dumps. So - I think it is perfectly fine to assume that the size of swap sums up with used space.

Changed in nova:
status: New → Invalid
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.