Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-57469

Not able to use custom image with associated plan (Marketplace image requires Plan information in the request' error)

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Duplicate
    • Component/s: _unsorted
    • Labels:
      None
    • Environment:
      Jenkins 2.164.3
      Azure VM Agents 0.9.0
    • Similar Issues:

      Description

      Hello,

      It's not possible to use a custom image with attached  plan (created from the Market place)

      For example using RancherOS 1.5.1

      • Create an custom image using Packer (inject SSH keys, configure engine etc..)
      • Use this custom image to start new machines using SSH

      We cannot do it because the API is expecting we pass the plan information in the request

      Creating a virtual machine from Marketplace image requires Plan information in the request
      

      In case of packer it stores the plan information directly on the tags of the image

        "tags": {
          "PlanInfo": "os",
          "PlanProduct": "rancheros",
          "PlanPromotionCode": "",
          "PlanPublisher": "rancher",
          "provisioned_by": "packer"
        },
      

      Works if using the cli

      az vm create --name whatever  --image /subscriptions/<whatever>/resourceGroups/<whatever>/providers/Microsoft.Compute/images/<my image> --plan-name os --plan-product rancheros --plan-publisher rancher 
      

      So can we automatically get those information from Packer tag and pass them on the requestion ?

      Or UI/configuration must be updated to enter those information to the user ?

      Basically same of JENKINS-52407 but for custom image, not only marketplace

      Thanks again for the work on this plugin. It solve use many use cases!

        Attachments

          Issue Links

            Activity

            Hide
            jieshe Jie Shen added a comment -

            Valentin Delaye Could you please provide any sample of your configuration so that I could test on your case? 

            Show
            jieshe Jie Shen added a comment - Valentin Delaye Could you please provide any sample of your configuration so that I could test on your case? 
            Hide
            jonesbusy Valentin Delaye added a comment -

            Hello,

            Here is an example of the packer config to create a custom image from a market place with associated plan

            Packer template :

            {
                "variables": {
                    "client_id": "{{env `ARM_CLIENT_ID`}}",
                    "client_secret": "{{env `ARM_CLIENT_SECRET`}}",
                    "subscription_id": "{{env `ARM_SUBSCRIPTION_ID`}}",
                    "provisioned_by": "packer",
                    "resource_group_name": "your-resource-group",
                    "build_resource_group_name" : "your-resource-group",
                    "image_name" : "RancherOS-1.5.1-rancher",
                    "image_sku" : "os",
                    "image_version" : "1.5.1",
                    "vm_size" : "Standard_DS1_v2",
                    "os_disk_size_gb" : "32",
                    "version" : "1.5.1"
                },
            
                "builders": [
                    {
                        "type": "azure-arm",
                        "client_id": "{{user `client_id`}}",
                        "client_secret": "{{user `client_secret`}}",
                        "subscription_id": "{{user `subscription_id`}}",
                        "os_type": "Linux",
                        "image_publisher": "rancher",
                        "image_offer": "rancheros",
                        "image_sku": "{{user `image_sku`}}",
                        "image_version" : "{{user `image_version`}}",
                        "managed_image_resource_group_name": "{{user `resource_group_name`}}",
                        "managed_image_name": "{{user `image_name`}}-v{{user `version`}}",
                        "build_resource_group_name" : "{{user `build_resource_group_name`}}",
                        "ssh_username": "rancher",
                        "ssh_password": "rancher",
                        "ssh_port": 22,
                        "azure_tags": {
                            "TechnicalOwner": "Someone"    
                        },
                        "plan_info": {
                            "plan_name": "os",
                            "plan_product": "rancheros",
                            "plan_publisher": "rancher"
                        },
                        "vm_size": "{{user `vm_size`}}"
                    }
                ],
                "provisioners": [
                    {
                        "type": "shell",
                        "inline": [
            		"sudo ros engine list",
                            "sudo ros engine switch docker-18.09.5",
                            "sudo ros engine enable docker-18.09.5"
                        ]
                    }
                ]
            }
            
            Show
            jonesbusy Valentin Delaye added a comment - Hello, Here is an example of the packer config to create a custom image from a market place with associated plan Packer template : { "variables" : { "client_id" : "{{env `ARM_CLIENT_ID`}}" , "client_secret" : "{{env `ARM_CLIENT_SECRET`}}" , "subscription_id" : "{{env `ARM_SUBSCRIPTION_ID`}}" , "provisioned_by" : "packer" , "resource_group_name" : "your-resource-group" , "build_resource_group_name" : "your-resource-group" , "image_name" : "RancherOS-1.5.1-rancher" , "image_sku" : "os" , "image_version" : "1.5.1" , "vm_size" : "Standard_DS1_v2" , "os_disk_size_gb" : "32" , "version" : "1.5.1" }, "builders" : [ { "type" : "azure-arm" , "client_id" : "{{user `client_id`}}" , "client_secret" : "{{user `client_secret`}}" , "subscription_id" : "{{user `subscription_id`}}" , "os_type" : "Linux" , "image_publisher" : "rancher" , "image_offer" : "rancheros" , "image_sku" : "{{user `image_sku`}}" , "image_version" : "{{user `image_version`}}" , "managed_image_resource_group_name" : "{{user `resource_group_name`}}" , "managed_image_name" : "{{user `image_name`}}-v{{user `version`}}" , "build_resource_group_name" : "{{user `build_resource_group_name`}}" , "ssh_username" : "rancher" , "ssh_password" : "rancher" , "ssh_port" : 22, "azure_tags" : { "TechnicalOwner" : "Someone" }, "plan_info" : { "plan_name" : "os" , "plan_product" : "rancheros" , "plan_publisher" : "rancher" }, "vm_size" : "{{user `vm_size`}}" } ], "provisioners" : [ { "type" : "shell" , "inline" : [ "sudo ros engine list" , "sudo ros engine switch docker-18.09.5" , "sudo ros engine enable docker-18.09.5" ] } ] }
            Hide
            timja Tim Jacomb added a comment -

            All issues have been transferred to GitHub.

            See https://github.com/jenkinsci/azure-vm-agents-plugin/issues

            Search the issue title to find it.

            (This is a bulk comment and can't link to the specific issue)

            Show
            timja Tim Jacomb added a comment - All issues have been transferred to GitHub. See https://github.com/jenkinsci/azure-vm-agents-plugin/issues Search the issue title to find it. (This is a bulk comment and can't link to the specific issue)

              People

              Assignee:
              jieshe Jie Shen
              Reporter:
              jonesbusy Valentin Delaye
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: