jenkinsci / azure-vm-agents-plugin

This repo is for azure vm agents plugin for jenkins. Azure devops CICD is the team which owns it for now
https://plugins.jenkins.io/azure-vm-agents/
43 stars 96 forks source link

Creating VM out of Custom image with Plan and Publisher information fails #449

Closed Monishguru closed 1 year ago

Monishguru commented 1 year ago

Jenkins and plugins versions report

Environment ```text Jenkins: 2.368 OS: Linux - 5.15.0-1042-azure Java: 11.0.18 - Eclipse Adoptium (OpenJDK 64-Bit Server VM) --- Office-365-Connector:4.15.2 ace-editor:1.1 ant:481.v7b_09e538fcca antisamy-markup-formatter:2.1 apache-httpcomponents-client-4-api:4.5.13-138.v4e7d9a_7b_a_e61 artifactory:3.11.4 authentication-tokens:1.4 authorize-project:1.4.0 azure-ad:191.vfc8019068670 azure-credentials:254.v64da_8176c83a azure-keyvault:123.v1aba71c2d365 azure-sdk:132.v62b_48eb_6f32f azure-vm-agents:789.va0c40e4d0070 badge:1.9.1 bootstrap4-api:4.6.0-3 bootstrap5-api:5.2.1-3 bouncycastle-api:2.27 branch-api:2.1071.v1a_188a_562481 build-timeout:1.20 caffeine-api:2.9.3-65.v6a_47d0f4d1fe checks-api:1.8.1 cloud-stats:267.v577e3742c282 cloudbees-folder:6.758.vfd75d09eea_a_1 cmakebuilder:4.1.1 command-launcher:1.2 commons-lang3-api:3.12.0-36.vd97de6465d5b_ commons-text-api:1.10.0-27.vb_fa_3896786a_7 config-file-provider:3.11.1 configuration-as-code:1569.vb_72405b_80249 credentials:1189.vf61b_a_5e2f62e credentials-binding:523.vd859a_4b_122e6 display-url-api:2.3.7 durable-task:503.v57154d18d478 echarts-api:5.4.0-1 email-ext:2.83 extended-read-permission:3.2 file-operations:1.11 file-parameters:285.v757c5b_67a_c25 font-awesome-api:6.2.1-1 git:4.11.5 git-client:4.1.0 git-server:99.va_0826a_b_cdfa_d github:1.36.1 github-api:1.303-400.v35c2d8258028 github-branch-source:2.11.3 gradle:1.39.1 handlebars:3.0.8 htmlpublisher:1.30 http_request:1.16 instance-identity:142.v04572ca_5b_265 ionicons-api:31.v4757b_6987003 ivy:2.4 jackson2-api:2.15.2-350.v0c2f3f8fc595 jakarta-activation-api:2.0.1-2 jakarta-mail-api:2.0.1-2 javadoc:226.v71211feb_e7e9 javax-activation-api:1.2.0-6 javax-mail-api:1.6.2-5 jaxb:2.3.8-1 jdk-tool:1.0 jira-steps:2.0.141.vd0c6e6dc83f0 jjwt-api:0.11.5-77.v646c772fddb_0 job-dsl:1.79 jquery-detached:1.2.1 jquery3-api:3.6.1-2 jsch:0.2.8-65.v052c39de79b_2 junit:1166.va_436e268e972 kubernetes:3690.va_9ddf6635481 kubernetes-client-api:6.3.1-206.v76d3b_6b_14db_b kubernetes-credentials:0.10.0 ldap:2.7 mailer:435.v79ef3972b_5c7 matrix-auth:3.1 matrix-project:785.v06b_7f47b_c631 maven-plugin:3.20 metrics:4.2.13-420.vea_2f17932dd6 mina-sshd-api-common:2.9.2-50.va_0e1f42659a_a mina-sshd-api-core:2.9.2-50.va_0e1f42659a_a momentjs:1.1.1 okhttp-api:4.9.3-108.v0feda04578cf pam-auth:1.6 pipeline-build-step:2.18 pipeline-github-lib:1.0 pipeline-graph-analysis:202.va_d268e64deb_3 pipeline-groovy-lib:629.vb_5627b_ee2104 pipeline-input-step:466.v6d0a_5df34f81 pipeline-milestone-step:111.v449306f708b_7 pipeline-model-api:2.2118.v31fd5b_9944b_5 pipeline-model-definition:2.2118.v31fd5b_9944b_5 pipeline-model-extensions:2.2118.v31fd5b_9944b_5 pipeline-rest-api:2.30 pipeline-stage-step:296.v5f6908f017a_5 pipeline-stage-tags-metadata:2.2118.v31fd5b_9944b_5 pipeline-stage-view:2.19 pipeline-utility-steps:2.13.0 plain-credentials:143.v1b_df8b_d3b_e48 plugin-util-api:2.20.0 popper-api:1.16.1-2 popper2-api:2.11.6-2 resource-disposer:0.20 robot:3.0.1 role-strategy:3.2.0 scm-api:631.v9143df5b_e4a_a script-security:1228.vd93135a_2fb_25 snakeyaml-api:1.33-95.va_b_a_e3e47b_fa_4 ssh-credentials:305.v8f4381501156 ssh-slaves:1.33.0 sshd:3.275.v9e17c10f2571 structs:324.va_f5d6774f3a_d timestamper:1.13 token-macro:321.vd7cc1f2a_52c8 trilead-api:2.84.v72119de229b_7 variant:59.vf075fe829ccb workflow-aggregator:590.v6a_d052e5a_a_b_5 workflow-api:1208.v0cc7c6e0da_9e workflow-basic-steps:994.vd57e3ca_46d24 workflow-cps:3606.v0b_d8b_e512dcf workflow-cps-global-lib:609.vd95673f149b_b workflow-durable-task-step:1223.v7f1a_98a_8863e workflow-job:1268.v6eb_e2ee1a_85a workflow-multibranch:716.vc692a_e52371b_ workflow-scm-step:400.v6b_89a_1317c9a_ workflow-step-api:639.v6eca_cd8c04a_a_ workflow-support:839.v35e2736cfd5c ws-cleanup:0.39 ```

What Operating System are you using (both controller, and any agents involved in the problem)?

Windows

Reproduction steps

  1. We are creating a custom vm image on top of the Hardened CIS base image from the azure market place. This hardened image has the following plan and publisher information

Purchase plan name cis-windows-10-l1 Purchase plan publisher name center-for-internet-security-inc Purchase plan product name cis-windows-10-l1

Similarly the custom image definition which we created have similar information as above with our own plan name and publisher name.

  1. We are trying to bring this VM up using the azure vm agents plugin. Under the Image Configuration tab we select the Advanced Image Configuration --> Gallery Image --> We are providing the correct Gallery Subscription Id,Resource Group,Gallery Name,Image Definition and Image Version

Expected Results

VM deployment to be in complete state

Actual Results

Deployment fails with the following error in Azure

"{\"status\":\"Failed\",\"error\":{\"code\":\"ResourceOperationFailure\" ,\"message\":\"The resource operation completed with terminal provisioning state ' Failed'.\",\"details\":[{\"code\":\"VMMarketplaceInvalidInput\",\"message\":\ "Creating a virtual machine from Marketplace image or a custom image sourced from a Marketplace image requires Plan information in the request.

And in Jenkins System Log i could see Deployment Failed - Conflict error message

Anything else?

Seems we should include the plan and publisher information in the call

timja commented 1 year ago

Duplicate of https://github.com/jenkinsci/azure-vm-agents-plugin/issues/222