Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1852061

Summary: MachineSets: missing replicas in spec breaks autoscaler
Product: OpenShift Container Platform Reporter: Joel Speed <jspeed>
Component: Cloud ComputeAssignee: Joel Speed <jspeed>
Cloud Compute sub component: Other Providers QA Contact: sunzhaohua <zhsun>
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: unspecified CC: agarcial, deads, hongkliu, jhou, jspeed, mgugino, zhsun
Version: 4.3.0   
Target Milestone: ---   
Target Release: 4.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: The replicas field in the spec of a MachineSet can be set to a nil value Consequence: The autoscaler cannot determine the current number of replicas within the MachineSet and therefore cannot perform any scaling operations Fix: If the replicas field is not set within the spec, fall back to the replicas field within the status which comes from the last number of observed replicas by the MachineSet Result: The autoscaler can make scaling decisions when the spec replicas field is nil, assuming the MachineSet controller has recently synced the number of replicas to the status
Story Points: ---
Clone Of: 1820654 Environment:
Last Closed: 2020-10-27 16:10:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1820654, 1827307, 1835160    

Comment 3 sunzhaohua 2020-07-09 07:53:49 UTC
verified
clusterversion: 4.6.0-0.nightly-2020-07-07-233934

steps: 
1. Edit machineset zhsunaws78-cvvl8-worker-us-east-2c with "replicas: "
2. Create clusterautoscaler	
3. Create machineautoscale 
$ oc get machineautoscaler
NAME       REF KIND     REF NAME                             MIN   MAX   AGE
worker-c   MachineSet   zhsunaws78-cvvl8-worker-us-east-2c   1     3     20m

4. Check the autoscale logs, 
W0709 07:41:47.928811       1 clusterapi_machineset.go:77] MachineSet "zhsunaws78-cvvl8-worker-us-east-2c" has nil spec.replicas. This is unsupported behaviour. Falling back to status.replicas.

5. Create workload to scale up the cluster, autoscaler could scale up
W0709 07:42:12.166424       1 clusterapi_machineset.go:77] MachineSet "zhsunaws78-cvvl8-worker-us-east-2c" has nil spec.replicas. This is unsupported behaviour. Falling back to status.replicas.
I0709 07:42:12.166474       1 scale_up.go:570] Final scale-up plan: [{openshift-machine-api/zhsunaws78-cvvl8-worker-us-east-2c 1->3 (max: 3)}]
I0709 07:42:12.166506       1 scale_up.go:659] Scale-up: setting group openshift-machine-api/zhsunaws78-cvvl8-worker-us-east-2c size to 3
W0709 07:42:12.365423       1 clusterapi_machineset.go:77] MachineSet "zhsunaws78-cvvl8-worker-us-east-2c" has nil spec.replicas. This is unsupported behaviour. Falling back to status.replicas.

Comment 5 errata-xmlrpc 2020-10-27 16:10:28 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 (OpenShift Container Platform 4.6 GA Images), 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/RHBA-2020:4196