Bug 2093044 - Azure machine-api-provider-azure Availability Set Name Length Limit
Summary: Azure machine-api-provider-azure Availability Set Name Length Limit
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Cloud Compute
Version: 4.10
Hardware: All
OS: Linux
urgent
urgent
Target Milestone: ---
: 4.11.0
Assignee: Michael McCune
QA Contact: sunzhaohua
URL:
Whiteboard:
Depends On:
Blocks: 2093275
TreeView+ depends on / blocked
 
Reported: 2022-06-02 19:34 UTC by Peter Kostyukov
Modified: 2022-08-10 11:16 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Procedural generated names for Azure availability sets exceed 80 character maximum limit. Consequence: Instead of creating multiple availability sets, the Machine API might reuse the same sets due to name truncation. This can cause unexpected behavior for users. Fix: The procedure to generate availability sets has been updated to ensure that the name is not longer than 80 characters and that the cluster name is not duplicated in the set name. Result: Availability sets are no longer truncated in unexpected ways by the procedural name generator.
Clone Of:
Environment:
Last Closed: 2022-08-10 11:16:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift machine-api-provider-azure pull 22 0 None open Bug 2093044: update getAvailabilitySetName function 2022-06-02 19:41:46 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 11:16:45 UTC

Comment 1 Peter Kostyukov 2022-06-02 19:36:27 UTC
PR by @mimccune : https://github.com/openshift/machine-api-provider-azure/pull/22

Comment 2 Peter Kostyukov 2022-06-02 19:38:55 UTC
This needs to be backported to OCP 4.10. Currently, blocking ARO (Azure Red Hat OpenShift) 4.10 release due to this bug discovered by ARO SRE during the E2E validation.

Comment 3 Michael McCune 2022-06-02 19:40:55 UTC
i don't think this will problematic to backport, but the team does need to assess the risk. assuming everything is ok, i will clone this bz and make the backport against 4.10 once we have the current PR merged.

Comment 8 Milind Yadav 2022-06-06 14:20:15 UTC
Validation1:
Gave name more than 80 chars and tried creating machineset 

[miyadav@miyadav azure]$ oc create -f ms2093044.yaml 
Error from server (spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"machine.openshift.io/cluster-api-cluster":"miyadav-0606az-2hrxz", "machine.openshift.io/cluster-api-machineset":"miyadav-0606az-2hrxz-worker-northcentralus-miyadav-miyadav-0606az-2hrxz-miyadav-0606az-2hrxz"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: could not convert label selector to selector: values[0][machine.openshift.io/cluster-api-machineset]: Invalid value: "miyadav-0606az-2hrxz-worker-northcentralus-miyadav-miyadav-0606az-2hrxz-miyadav-0606az-2hrxz": must be no more than 63 characters): error when creating "ms2093044.yaml": admission webhook "validation.machineset.machine.openshift.io" denied the request: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"machine.openshift.io/cluster-api-cluster":"miyadav-0606az-2hrxz", "machine.openshift.io/cluster-api-machineset":"miyadav-0606az-2hrxz-worker-northcentralus-miyadav-miyadav-0606az-2hrxz-miyadav-0606az-2hrxz"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: could not convert label selector to selector: values[0][machine.openshift.io/cluster-api-machineset]: Invalid value: "miyadav-0606az-2hrxz-worker-northcentralus-miyadav-miyadav-0606az-2hrxz-miyadav-0606az-2hrxz": must be no more than 63 characters


If I keep the name less than or equal to 63 chars I get the machinesets created , also attaching the availability sets created , they have the concatinated string '-as' in them , when the machineset did not had the name of cluster it added along with '-as'

Please have a look once - 

[miyadav@miyadav azure]$ oc get machines 
NAME                                                              PHASE         TYPE              REGION           ZONE   AGE
2hrxz-worker-test12345678912345678912345678912345678912345g229l   Provisioned   Standard_D4s_v3   northcentralus          5m36s
miyadav-0606az-2hrxz-master-0                                     Running       Standard_D8s_v3   northcentralus          71m
miyadav-0606az-2hrxz-master-1                                     Running       Standard_D8s_v3   northcentralus          71m
miyadav-0606az-2hrxz-master-2                                     Running       Standard_D8s_v3   northcentralus          71m
miyadav-0606az-2hrxz-worker-northcentralus-vb9l5                  Running       Standard_D4s_v3   northcentralus          63m
miyadav-0606az-2hrxz-worker-q-wcjg2                               Running       Standard_D4s_v3   northcentralus          17m
miyadav-0606az-2hrxz-worker-qwertyuioppppppppppppppppppppp4xtc5   Deleting      Standard_D4s_v3   northcentralus          19m
miyadav-0606az-2hrxz-worker-qwertyuiopppppppppppppppppppppvcjdk   Running       Standard_D4s_v3   northcentralus          19m
[miyadav@miyadav azure]$ oc get machineset 
NAME                                                             DESIRED   CURRENT   READY   AVAILABLE   AGE
2hrxz-worker-test123456789123456789123456789123456789123456789   1         1         1       1           11m
miyadav-0606az-2hrxz-worker-northcentralus                       1         1         1       1           77m
miyadav-0606az-2hrxz-worker-q                                    1         1         1       1           22m
miyadav-0606az-2hrxz-worker-qwertyuioppppppppppppppppppppppppp   1         1         1       1           24m
[miyadav@miyadav azure]$ 


Additional info:
LGTM , attaching snaps of availablity sets.

Comment 10 Milind Yadav 2022-06-06 14:40:03 UTC
[miyadav@miyadav azure]$ oc get clusterversion
NAME      VERSION                              AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.11.0-0.nightly-2022-06-04-014713   True        False         61m     Cluster version is 4.11.0-0.nightly-2022-06-04-014713


Summarising steps :

Create machineset with containing cluster name ex above 
miyadav-0606az-2hrxz-worker-q

Expected and Actual:
Availabity set will be created with appending '-as' to the machineset name and the clustername is not added to it.

Create machineset without cluster name ex-above 
2hrxz-worker-test123456789123456789123456789123456789123456789 

Actual and expected :
Clustername prefixed to avalabilitysets and suffixed with '-as' 



Additionally cluster should be created in region without availability zones refer  - https://azure.microsoft.com/en-us/global-infrastructure/geographies/#geographies

Comment 13 errata-xmlrpc 2022-08-10 11:16:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: OpenShift Container Platform 4.11.0 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5069


Note You need to log in before you can comment on or make changes to this bug.