[JIRA] (JENKINS-57469) Not able to use custom image with associated plan (Marketplace image requires Plan information in the request' error)

22 views
Skip to first unread message

jonesbusy@gmail.com (JIRA)

unread,
May 14, 2019, 2:26:03 PM5/14/19
to jenkinsc...@googlegroups.com
Valentin Delaye created an issue
 
Jenkins / Improvement JENKINS-57469
Not able to use custom image with associated plan (Marketplace image requires Plan information in the request' error)
Issue Type: Improvement Improvement
Assignee: Azure DevOps
Components: azure-vm-agents-plugin
Created: 2019-05-14 18:25
Environment: Jenkins 2.164.3
Azure VM Agents 0.9.0
Priority: Minor Minor
Reporter: Valentin Delaye

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!

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

vscjenkins@microsoft.com (JIRA)

unread,
May 14, 2019, 9:33:02 PM5/14/19
to jenkinsc...@googlegroups.com
Azure DevOps started work on Improvement JENKINS-57469
 
Change By: Azure DevOps
Status: Open In Progress

vscjenkins@microsoft.com (JIRA)

unread,
May 14, 2019, 9:33:03 PM5/14/19
to jenkinsc...@googlegroups.com

jieshe@microsoft.com (JIRA)

unread,
May 14, 2019, 10:02:03 PM5/14/19
to jenkinsc...@googlegroups.com
Jie Shen commented on Improvement JENKINS-57469
 
Re: Not able to use custom image with associated plan (Marketplace image requires Plan information in the request' error)

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

jonesbusy@gmail.com (JIRA)

unread,
May 15, 2019, 7:33:02 AM5/15/19
to jenkinsc...@googlegroups.com

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"
            ]
        }
    ]
}
Reply all
Reply to author
Forward
0 new messages