Last spam for tonight!

This seems to be the spec from Mitaka - the code with None dates from 6 years ago.

https://specs.openstack.org/openstack/nova-specs/specs/mitaka/approved/virt-device-role-tagging.html

I think my comprehension is wrong, but the intent is around exposing non regular devices (VF, PCI drives). I don't have a way to try that in my lab, so I'll need to check elsewhere.

On Tue, Apr 5, 2022 at 8:37 PM Laurent Dumont <laurentfdumont@gmail.com> wrote:
After adding some POTATO debugs, it seems that meta_data generation does not actually happen for the instances I have tested.

        vif_vfs_trusted_supported = self._check_os_version(ROCKY, version)
        LOG.info('POTATO -3 CHECKING IF WE HAVE DEVICE_METADATA| '+str(self.instance.device_metadata))
        if self.instance.device_metadata is not None:
            LOG.info('device_metadata is not None| '+str(self.instance.device_metadata))
            for device in self.instance.device_metadata.devices:
                device_metadata = {}
                bus = 'none'

In my logs
2022-04-06 00:33:08.541 30 INFO nova.api.metadata.base [req-15612a39-649f-4598-b588-ebcceedd49b1 - - - - -] POTATO -3 CHECKING IF WE HAVE DEVICE_METADATA| None

device_metadata = None so the condition is False so it skips all that code. It seems a bit strange, since None would mean there is nothing so let's add some data?

I am not clear on how self.instance.device_metadata is expected to behave. I'll have to dig a little deeper.

On Tue, Apr 5, 2022 at 7:58 PM Laurent Dumont <laurentfdumont@gmail.com> wrote:
Trying to trace the code that I dont fully grasp :D 

We start in nova/base.py

We seem to generate a device array with a bunch of stuff inside

        if self._check_os_version(NEWTON_ONE, version):
            metadata['devices'] = self._get_device_metadata(version)

(but only if the version is higher than NEWTON_ONE? I dont think we generate the file every single time someone calls the API so it's probably at VM creation only?)

Looking at the code for _get_device_metadata


It seems we try to build an array for Metadata specifically. It's not expected to be a full list of all the actual devices (ports + disks).

I'll see if I add a tag to a port, does it now show up?

On Tue, Apr 5, 2022 at 7:29 PM Laurent Dumont <laurentfdumont@gmail.com> wrote:
Circling back on this, I see the same in my kolla-ansible + Ussuri.

{"uuid": "a916a95d-3f9b-4e5e-9f64-894470742d8b", "hostname": "test-laurent.novalocal", "name": "test-laurent", "launch_index": 0, "availability_zone": "nova", "random_seed": "EEO9FjZLP51L4DDzQV09NRlwUeuKQa+XlGEWp3nH3XKXCnM5vEwhVgw/qG2kuqLN3HZ+oQIcLsnFPwoCsr5TuYodLTTTEhHgo0xJwZ3mlY/P6Br7QWCOyXCDEIKDxxfvxXhDOKtf9OFkFNROD9GDc4vWrOeCDGtcKshf5QZLsgiIv07fQus9axsqGYosNPdOKAejRa+gVtQfxlqV0kVcVIWWOAQOQdVh/TfoBGaxc8FjSCj/9MHLUMYP/zPSj+NRU4G1AwlKHzmxxiF4LQwHCBuy6dNrG+ImpUs6nLORjlDAgovoMhwIgDVhgihel4eFoT8f2izuq42yCen7yRU7FSfJcL40IlTmdHVTJTfChS2+yP5Y5SjeNHAmO6xCRJ9CCliRXIj8hsCjD0triQi2LCMC/gvZoaLSeczSzUgmL3zEFB+9IcalUuvf4yChK2OqpGfK94YlWR/U7fivdyUMChlaUC9BilPJUkUpCPL2wHiKKQMpPVFK5sRZoFe7nnegLRrMvYKuCPbtp99VqCCm2ts/6u6dgCHZdUD+NvOYUOMBGXYcQz0DVIpF/HyAI+AuW/5HAPCw66NZfwsCfMugzGf5+ljm8zr4UU//pf0vMCVX690dGyVraB/ozuXg1rdQYF8f7iDh9v2vkR+oanuC1sY6bHV+DRMhfc/Xp+KFDCc=", "project_id": "4db7dbf9961c4fc6a4589a5cb2ae3c9a", "devices": []}#

Nothing in Devices

But I see it in the network endpoint

# curl http://169.254.169.254/openstack/2018-08-27/network_data.json
{"links": [{"id": "tap1b4490ec-76", "vif_id": "1b4490ec-76b9-4223-9a31-837d60b13cc2", "type": "ovs", "mtu": 1450, "ethernet_mac_address": "fa:16:3e:58:a4:4a"}], "networks": [{"id": "network0", "type": "ipv4_dhcp", "link": "tap1b4490ec-76", "network_id": "bef77274-defd-463c-814a-5051ea2acae0"}], "services": []}# 

I'll look at the code, but I am not clear where that snippet is being generated. It could be expected that the devices array is empty.

On Sun, Mar 20, 2022 at 11:11 AM Ahmed Abdelhamid <ahmedabdelhamid1221@gmail.com> wrote:
Thanks. It's OpenStack ussuri, deployed via kolla-ansible 

On Fri, Mar 18, 2022 at 10:06 PM Laurent Dumont <laurentfdumont@gmail.com> wrote:
That is weird.
  • What version of Openstack are you running?
  • How was it deployed?

On Fri, Mar 18, 2022 at 9:30 AM Ahmed Abdelhamid <ahmedabdelhamid1221@gmail.com> wrote:
Thanks, Laurent. I tried it for both CEPH-backed VMs and ones with local disk, still, the devices array is empty

Network data curl shows alright

{"links": [{"id": "tapa.....", "vif_id": "ae....", "type": "bridge", "mtu": 1500, "ethernet_mac_address": "fa:......."}], "networks": [{"id": "network0", "type": "ipv4_dhcp", "link": "tap.....

On Wed, Mar 16, 2022 at 6:39 PM Laurent Dumont <laurentfdumont@gmail.com> wrote:
Are you getting anything from the neutron endpoint?


Can you provide an "openstack server show $server_id" of the VM? I wonder if it's a case of boot from a volume VM missing that data. It would not explain why the port is not there though.

On Tue, Mar 15, 2022 at 9:15 AM Ahmed Abdelhamid <ahmedabdelhamid1221@gmail.com> wrote:
Hi All,

I am running into a strange issue with the metadata service. Per metadata-service manual, the devices attached to a VM should be visible in 


However, whenever i execute it from a VM , the devices array is empty and looks like this, any idea why ?

Thanks

{
   "random_seed": "yu5ZnkqF2CqnDZVAfZgarG...",
   "availability_zone": "nova",
   "keys": [
       {
         "data": "ssh-rsa AAAAB3NzaC1y...== Generated by Nova\n",
         "type": "ssh",
         "name": "mykey"
       }
   ],
   "hostname": "test.novalocal",
   "launch_index": 0,
   "meta": {
      "priority": "low",
      "role": "webserver"
   },
   "devices": [ ],
   "project_id": "f7ac731cc11f40efbc03a9f9e1d1d21f",
   "public_keys": {
       "mykey": "ssh-rsa AAAAB3NzaC1y...== Generated by Nova\n"
   },
   "name": "test"
}