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

When VM naming number padding 1, machine “10” is named “vmname01” instead of “vmname10” #149

Open
gerikis opened this issue Mar 21, 2019 · 3 comments

Comments

@gerikis
Copy link

gerikis commented Mar 21, 2019

When VM naming number padding 1, the first 9 machines are created correctly (vmname1-vmname9),
however machine “10” is named “vmname01” instead of “vmname10”.

Name must be machine1, machine2, machine3 ... machine10, machine11, and so on.

The padding is configured via " vm_name_suffix_counter_length" = 1 in the instance: RedHatConsulting_Utilities (v11.5) / Infrastructure / VM / Provisioning / Configuration / default.

The code used for naming is / RedHatConsulting_Utilities / Infrastructure / VM / Provisioning / Naming / vmname, on line 72:
"$n{#{suffix_counter_length}}"

"This has to do with how the $n{#} syntax works in CFME not specifically with this code. The miq-Utitlities code is just taking that vm_name_suffix_counter_length and putting it in $n{#{suffix_counter_length}} as seen here https://github.com/RedHatOfficial/miq-Utilities/blob/master/Automate/RedHatConsulting_Utilities/Infrastructure/VM/Provisioning/Naming.class/__methods__/vmname.rb#L72. From there the built in CFME naming functions that know how to read the $n(#) syntax take over. "

According to https://bugzilla.redhat.com/show_bug.cgi?id=1688672 this is working as designed in miq-Utilities .
I believe this must be fixed in RedHatConsulting_Utilities /

Another question if RH consulting script have another way how to generate a number after $n(1) is overflowing , or why RH consulting script rely on miq-utilities with generating a number.

https://github.com/RedHatOfficial/miq-Utilities/blob/master/Automate/RedHatConsulting_Utilities/Infrastructure/VM/Provisioning/Naming.class/__methods__/vmname.rb#L72

@itewk
Copy link
Collaborator

itewk commented Mar 21, 2019

@gerikis this is not something the current team maintaining these scripts is prepared to take on. Solvign the problems of incremental parallelized naming without using $n{} is an insanely difficult and troublesome problem to solve and is already solved by $n{} and would be far simpler and make far more sense to update $n{} to increment more logically, even if it currently "works as designed".

I am willing to leave this open if this is something you want to try and make another alternative naming method that doesn't use the $n{} but if you are looking for the couple of volunteers who maintain this currently to take this on it's not likely to ever happen so I don't want anyone to get their hopes up.

@gerikis
Copy link
Author

gerikis commented Mar 21, 2019

Thank you Ian, for the help ,highly appreciated . Hopefully later on somebody might takes a challenge (this issue) , or will taken consideration and will affect future developments.

@itewk
Copy link
Collaborator

itewk commented Mar 21, 2019

@gerikis I suggest setting your padding to a succificently high number in the mean time.

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

2 participants