Bug 2027896

Summary: Update Azure Machine Spec API to accept Marketplace Images
Product: OpenShift Container Platform Reporter: Patrick Dillon <padillon>
Component: Cloud ComputeAssignee: Patrick Dillon <padillon>
Cloud Compute sub component: Other Providers QA Contact: sunzhaohua <zhsun>
Status: CLOSED ERRATA Docs Contact:
Severity: urgent    
Priority: urgent CC: gpei, zhsun
Version: 4.8   
Target Milestone: ---   
Target Release: 4.8.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2025697
: 2027897 (view as bug list) Environment:
Last Closed: 2022-01-05 16:11:42 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: 2025697    
Bug Blocks: 2027897    

Comment 2 sunzhaohua 2021-12-14 03:51:09 UTC
After installation, create a new machineset will get error:
  conditions:
  - lastTransitionTime: "2021-12-14T01:14:14Z"
    message: 'Failed to check if machine exists: vm for machine zhsunaz14ipi-wnhrb-worker-northcentralus1-s56vm exists, but has unexpected ''Failed'' provisioning state'
    reason: ErrorCheckingProvider
    status: Unknown
    type: InstanceExists

Installation works as expected on 4.8.0-0.nightly-2021-12-13-183908.  
After generating manifests, modify the image spec in worker machineset as
      image:
        offer: ocp-worker
        publisher: redhat-rhel
        resourceID: ""
        sku: ocp-worker-100-gen1
        type: MarketplaceWithPlan
        version: 4.8.2021092400 
Installation finished successfully. Worker are created with expected image via machine-api.

Comment 5 sunzhaohua 2021-12-17 06:13:01 UTC
Seems no plan id in this 4.8 image, I cant set up cluster with it, worker machine failed with below error.
clusterversion: 4.8.0-0.nightly-2021-12-16-211324

# az vm image list --all --offer ocp-worker
[
 {
  "offer": "ocp-worker",
  "publisher": "redhat-rhel",
  "sku": "ocp-worker-100-gen1",
  "urn": "redhat-rhel:ocp-worker:ocp-worker-100-gen1:4.8.2021092400",
  "version": "4.8.2021092400"
 }
]
      message: 'failed to create vm zhsunipi3-mzh98-worker-centralus1-7z7gd: failure sending request for machine zhsunipi3-mzh98-worker-centralus1-7z7gd: cannot create vm: compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="ResourcePurchaseValidationFailed" Message="User failed validation to purchase resources. Error message: ''Offer with PublisherId: ''redhat-rhel'', OfferId: ''ocp-worker'' cannot be purchased due to validation errors. For more information see details. Correlation Id: ''529af651-c656-4d25-b07d-1ee365fd24f1'' Offer with PublisherId: ''redhat-rhel'', OfferId: ''ocp-worker'' and PlanId: ocp-worker-100-gen1 was removed from the marketplace for new purchase. See similar offers here ''https://azuremarketplace.microsoft.com/en-us/marketplace/apps?page=1%26search=redhat-rhel%20ocp-worker''. Correlation Id ''529af651-c656-4d25-b07d-1ee365fd24f1''.''"'
clusterversion: 4.8.0-0.nightly-2021-12-16-211324

Comment 7 sunzhaohua 2021-12-21 08:58:42 UTC
Verified
Tested with pr https://github.com/openshift/cluster-api-provider-azure/pull/245 and https://github.com/openshift/machine-api-operator/pull/970
1.After generating manifests, modify the image spec in worker machineset as
      image:
        offer: ocp-worker
        publisher: redhat-rhel
        resourceID: ""
        sku: ocp-worker-100-gen1
        type: MarketplaceWithPlan
        version: 4.8.2021092400 
Installation finished successfully
2.Post installtion create machineset with above image, machine works well.
3.Create a cluster with WMCO, windows node works well.

Comment 9 errata-xmlrpc 2022-01-05 16:11:42 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.8.25 bug fix 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/RHBA-2021:5209