Bug 2034563 - [Azure] create machine with wrong ephemeralStorageLocation value success
Summary: [Azure] create machine with wrong ephemeralStorageLocation value success
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Cloud Compute
Version: 4.10
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.10.0
Assignee: Mike Fedosin
QA Contact: Huali Liu
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-12-21 10:31 UTC by Huali Liu
Modified: 2022-03-10 16:36 UTC (History)
0 users

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-03-10 16:35:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift machine-api-operator pull 974 0 None open Bug 2034563: validate azure ephemeral storage location and caching type 2022-01-04 19:04:30 UTC
Red Hat Product Errata RHSA-2022:0056 0 None None None 2022-03-10 16:36:04 UTC

Description Huali Liu 2021-12-21 10:31:44 UTC
Description of problem:
Creating a machine with wrong ephemeralStorageLocation succeeds with ephemeral disk disabled. It should fail and give a corresponding message. As customers originally wanted to enable ephemeral disk, but the value was written incorrectly, we should give them friendly tips.
I also tried other parameters, if the wrong value is given, the machine created failed with a corresponding message.

Version-Release number of selected component (if applicable):
4.10.0-0.nightly-2021-12-18-034942

How reproducible:
Always

Steps to Reproduce:
1.Create a machineset with the wrong ephemeralStorageLocation value. For example, “localisedinvalid”, or other value
          osDisk:
            diskSizeGB: 30
            diskSettings:
              ephemeralStorageLocation: localisedinvalid
            cachingType: readonly
            osType: Linux

2.Check machine created successfully, the VM on azure portal Ephemeral OS disk shows N/A
liuhuali@Lius-MacBook-Pro huali-test % oc get machine huliu-003-hlww7-test6-8qw9n -o yaml
apiVersion: machine.openshift.io/v1beta1
kind: Machine
metadata:
  annotations:
    machine.openshift.io/instance-state: Running
  creationTimestamp: "2021-12-21T10:08:05Z"
  finalizers:
  - machine.machine.openshift.io
  generateName: huliu-003-hlww7-test6-
  generation: 3
  labels:
    machine.openshift.io/cluster-api-cluster: huliu-003-hlww7
    machine.openshift.io/cluster-api-machine-role: worker
    machine.openshift.io/cluster-api-machine-type: worker
    machine.openshift.io/cluster-api-machineset: huliu-003-hlww7-test6
    machine.openshift.io/instance-type: Standard_D4s_v3
    machine.openshift.io/region: centralus
    machine.openshift.io/zone: "1"
  name: huliu-003-hlww7-test6-8qw9n
  namespace: openshift-machine-api
  ownerReferences:
  - apiVersion: machine.openshift.io/v1beta1
    blockOwnerDeletion: true
    controller: true
    kind: MachineSet
    name: huliu-003-hlww7-test6
    uid: 958c08e2-dd0c-49a1-b08c-abebe553a4e0
  resourceVersion: "220762"
  uid: 66489f69-3c95-48f5-bc5a-20accaf429d4
spec:
  lifecycleHooks: {}
  metadata: {}
  providerID: azure:///subscriptions/53b8f551-f0fc-4bea-8cba-6d1fefd54c8a/resourceGroups/huliu-003-hlww7-rg/providers/Microsoft.Compute/virtualMachines/huliu-003-hlww7-test6-8qw9n
  providerSpec:
    value:
      apiVersion: machine.openshift.io/v1beta1
      credentialsSecret:
        name: azure-cloud-credentials
        namespace: openshift-machine-api
      image:
        offer: ""
        publisher: ""
        resourceID: /resourceGroups/huliu-003-hlww7-rg/providers/Microsoft.Compute/images/huliu-003-hlww7
        sku: ""
        version: ""
      kind: AzureMachineProviderSpec
      location: centralus
      managedIdentity: huliu-003-hlww7-identity
      metadata:
        creationTimestamp: null
        name: huliu-003-hlww7
      networkResourceGroup: huliu-003-hlww7-rg
      osDisk:
        cachingType: readonly
        diskSettings:
          ephemeralStorageLocation: localisedinvalid
        diskSizeGB: 30
        managedDisk:
          storageAccountType: ""
        osType: Linux
      publicIP: false
      publicLoadBalancer: huliu-003-hlww7
      resourceGroup: huliu-003-hlww7-rg
      subnet: huliu-003-hlww7-worker-subnet
      userDataSecret:
        name: worker-user-data
      vmSize: Standard_D4s_v3
      vnet: huliu-003-hlww7-vnet
      zone: "1"
status:
  addresses:
  - address: huliu-003-hlww7-test6-8qw9n
    type: Hostname
  - address: huliu-003-hlww7-test6-8qw9n
    type: InternalDNS
  - address: huliu-003-hlww7-test6-8qw9n.qcmcsyuc1htuzaq3wn0crbzd4e.gx.internal.cloudapp.net
    type: InternalDNS
  - address: 10.0.128.19
    type: InternalIP
  conditions:
  - lastTransitionTime: "2021-12-21T10:08:09Z"
    status: "True"
    type: InstanceExists
  lastUpdated: "2021-12-21T10:13:31Z"
  nodeRef:
    kind: Node
    name: huliu-003-hlww7-test6-8qw9n
    uid: 4045f3b2-abe6-4dc0-84c3-5b862da43144
  phase: Running
  providerStatus:
    conditions:
    - lastProbeTime: "2021-12-21T10:08:08Z"
      lastTransitionTime: "2021-12-21T10:08:08Z"
      message: machine successfully created
      reason: MachineCreationSucceeded
      status: "True"
      type: MachineCreated
    metadata: {}
    vmId: /subscriptions/53b8f551-f0fc-4bea-8cba-6d1fefd54c8a/resourceGroups/huliu-003-hlww7-rg/providers/Microsoft.Compute/virtualMachines/huliu-003-hlww7-test6-8qw9n
    vmState: Running
liuhuali@Lius-MacBook-Pro huali-test % 

Actual results:
Machine created successfully, ephemeral disk not enabled

Expected results:
Failed to create a machine, a corresponding message is provided.

Additional info:
https://issues.redhat.com/browse/OCPCLOUD-1362

Comment 3 Huali Liu 2022-01-10 03:24:22 UTC
Verified on 4.10.0-0.nightly-2022-01-07-224843
Steps:
Create a machineset with the wrong ephemeralStorageLocation value. For example, “localisedinvalid”, or other value
          osDisk:
            diskSizeGB: 30
            diskSettings:
              ephemeralStorageLocation: localisedinvalid
            cachingType: ReadOnly
            osType: Linux


liuhuali@Lius-MacBook-Pro huali-test % oc create -f ms1.yaml 
Error from server (providerSpec.osDisk.diskSettings.ephemeralStorageLocation: Invalid value: "localisedinvalid": osDisk.diskSettings.ephemeralStorageLocation can either be omitted or set to Local): error when creating "ms1.yaml": admission webhook "validation.machineset.machine.openshift.io" denied the request: providerSpec.osDisk.diskSettings.ephemeralStorageLocation: Invalid value: "localisedinvalid": osDisk.diskSettings.ephemeralStorageLocation can either be omitted or set to Local

Comment 6 errata-xmlrpc 2022-03-10 16:35:46 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 (Moderate: OpenShift Container Platform 4.10.3 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:0056


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