Hello, This is my python code:
import openstack
openstack.enable_logging(debug=False) hypervisors = [] conn = openstack.connect(cloud='region1') for hypervisor in conn.compute.hypervisors(details=True): hypervisors.append(hypervisor.to_dict()) I also run this:
for hypervisor in hypervisors:
print(hypervisor) This is the last result (other results are similar this):
{'cpu_info': None, 'host_ip': '1.1.1.1', 'hypervisor_type': 'QEMU', 'hypervisor_version': 6002000, 'name': 'some.fqdn.com', 'service_details': {'id': 'some-random-id', 'host': 'some.fqdn.com', 'disabled_reason': 'test'}, 'servers': None, 'state': 'up', 'status': 'disabled', 'uptime': ' 00:27:11 up 31 days, 10:14, 2 users, load average: 3.52, 3.20, 3.36\n', 'current_workload': None, 'disk_available': None, 'local_disk_used': None, 'local_disk_size': None, 'local_disk_free': None, 'memory_used': None, 'memory_size': None, 'memory_free': None, 'running_vms': None, 'vcpus_used': None, 'vcpus': None, 'id': 'some-random-id', 'location': Munch({'cloud': 'region1', 'region_name': 'Region1', 'zone': None, 'project': Munch({'id': 'somerandomid', 'name': None, 'domain_id': None, 'domain_name': None})})}
As you see, values like *cpu_info*, *disk_available*, *local_disk_used*, *local_disk_size*, *local_disk_free*, *memory_used*, etc are *None*. How can I have the following values? In the Openstack UI I see it says the free available disk, memory and CPU, but I don't know how to have them in python. I see here <https://docs.openstack.org/openstacksdk/latest/user/resources/compute/v2/hypervisor.html#openstack.compute.v2.hypervisor.Hypervisor.cpu_info> the above values, but for me all are None. Regards, Saeed