Open rvalle opened 2 years ago
I think this is because the API allows to filter by VPC, but does not return VPC information in the instance, which seems odd.
Without having this information returned by the API an implementation would be a very nasty workaround that would break the inventory plugin architecture. So, I have asked for that information returned by the API and then we will be able to cleanly implement in the inventory plugin:
https://github.com/apache/cloudstack/issues/6452
Meanwhile a viable workaround is to have 2 inventory files (using an inventory directory), one using the inventory plugin, and another using plain text to create supergroups like this:
[vpc:children]
net_tier1
net_tier2
net_tier3
[vpc2:children]
net_tier4
net_tier5
net_tier6
This would create 2 groups vpc and vpc2, that would include the hosts in the related tiers. For that to work first the inventory plugin must group by network like this:
keyed_groups:
- prefix: net
key: networks
Unfortunately this setup is only viable for few stable VPCs, as the tier to VPC supergroups file needs to be maintained manually.
good news, https://github.com/apache/cloudstack/issues/6452 has been implemented and will be released in ACS 4.17.1 We will then be able to implement this in the Iventory Plugin.
thanks @Pearl1594 for implementing this.
The inventory plugin documentation states that it is possible to filter instances by VPC,
However, it does not seem possible to group instances by VPC.
Is it possible?