Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inventory plugin group by VPC #106

Open
rvalle opened this issue Jun 12, 2022 · 4 comments
Open

Inventory plugin group by VPC #106

rvalle opened this issue Jun 12, 2022 · 4 comments

Comments

@rvalle
Copy link
Collaborator

rvalle commented Jun 12, 2022

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?

@rvalle
Copy link
Collaborator Author

rvalle commented Jun 12, 2022

I think this is because the API allows to filter by VPC, but does not return VPC information in the instance, which seems odd.

@rvalle
Copy link
Collaborator Author

rvalle commented Jun 13, 2022

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:

apache/cloudstack#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.

@rvalle
Copy link
Collaborator Author

rvalle commented Jun 20, 2022

good news, apache/cloudstack#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.

@rvalle
Copy link
Collaborator Author

rvalle commented Jun 20, 2022

thanks @Pearl1594 for implementing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant