network_data in metadata service not the same with network_data from configdrive when set ironic portgroup
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
When i use nova to boot a ironic instance and use portgroup to make nic bonds,I found network_data in metadata service is not the same with network_data from configdrive.
Cloud-init can only use the network_data from configdrive to make nic bonds.
I think the network_data.json from metadata and network_data.json from configdrive should be the same.
network_data from metadata service
{
"link": [{
"id": "tap9997f2061-e3",
"vif_id": "997f2062-
"type": "phy",
"mtu": "1500",
"ethernet_
}
],
"networks": [{
"id": "network0",
"type": "ipv6_dhcp",
"link": "tap9997f2061-e3",
"network_id": "27c2c6b3-
}
],
"services": []
}
network_data from configdrive
{
"link": [{
"id": "tap9997f2061-e3",
"vif_id": "997f2062-
"type": "bond",
"mtu": "1500",
"ethernet_
"bond_mode": "802.3ad",
"bond_links": ["038f035a-
"bond_miimon": 100
}, {
"id": "038f035a-
"type": "phy",
"ethernet_
}, {
"id": "32da47cc-
"type": "phy",
"ethernet_
}
],
"networks": [{
"id": "network0",
"type": "ipv6_dhcp",
"link": "tap9997f2061-e3",
"network_id": "27c2c6b3-
}
],
"services": []
}
Ironic virt driver generates the config driver here [1] with the networking metadata specific for ironic including the bonding. When the nova-metadata service gathers the metadata for an instance it calls the virt driver agnostic nova.virt. netutils. get_network_ metadata( )[2] that does not contain any virt driver specific information.
This causing the discrepancy between the content of the config driver and the content of the metadata service.
I'm not sure it is easy to fix but worth a discussion.
[1] https:/ /github. com/openstack/ nova/blob/ c37a4656bbbf6fc a169fb1456912a5 020f911698/ nova/virt/ ironic/ driver. py#L1076 /github. com/openstack/ nova/blob/ c37a4656bbbf6fc a169fb1456912a5 020f911698/ nova/virt/ netutils. py#L168
[2] https:/