-
Notifications
You must be signed in to change notification settings - Fork 330
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
Added possibility to assign RG name via env var ANSIBLE_AZURE_VMSS_RESOURCE_GROUPS for VMSS and Fix inventory fail when trying to parse instance from the flexible scale set #1440
Open
Justwmz
wants to merge
4
commits into
ansible-collections:dev
Choose a base branch
from
Justwmz:dev
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Justwmz In this way, uniform VMSS instances can be obtained. However, because flexible VMSS instances are similar to regular VMS, the flexible VMSS instances will be obtained twice. Is there any way to avoid this? Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Fred-sun Yes, there is the way to filter them out by the properties object, each flexible instance has a property which is indicated to which flexible scale set it is related.
I am just right now trying to test it, to see if that will works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Justwmz Thanks for your feedback! Look forward a good results! Thank you very much!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Fred-sun I tried multiple options to get it to work properly.
If you have VM and VMss RG's assigned to the same name where both types of scale sets are sitting, the call for pulling all VMs within RG will receive a list of those instances, since they are standalone VMs.
Maybe the better option will be to just obtain them as standalone VMs since they are pure VMs and need to be managed separately, not like in the Uniform instances which are managed by their parent?
P.S. I get one thing that works, which will parse the name of the instances from the Flexible scale set and then send a request per instance to obtain VM details. (But anyway, I still think that the ideal solution will be is ignore flexible parent since instances are managed separatly and just obtain them as VMs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Fred-sun To ignore flexible parent we just need to change this:
To this:
And it will work fine in all cases.
Maybe in the future MS will add support to get flexible ss instances in the same way as for the Uniform.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Justwmz That sounds great, but in my tests I found that I was returning regular VM information, not VMSS information! Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Fred-sun Yes you will be able to get info about scale set itself and list of the instances. But the key difference is that when you are obtaining a list of the instances in uniform scale set, it give you a full instance information.
In case of flexible scale set it will only present a limited information, like location, azure zone and 2-3 more parameters.
In order to get a full info about instance we need to use same api call as we are using for the standalone vms.
That’s why I basically propose ignore parent of the flexible scale set completely and only relay on the standalone vm api, since instances in the flexible scale set is standalone vms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Justwmz Yes, I agree with the idea of returning only VM or only the flexible VMSS instance VMS. VM are all virtual machines with a large range, while flexible VMSS instances are more precise. So we can filter and return flexible VMSS instance information. It's more accurate. Thank you!