Packer Classroom Series – 14 /Sep/19

Packer images for Azure Cloud

Differenes Compared To AWS

  1. After Creating a VM Image, VM becomes unusable

References

  1. VM Creation
  2. Packer Image Creation

Packer sample used in class room

{
    "variables": {
        "azure_subscription_id": "",
        "azure_client_id": "",
        "azure_client_secret": "",
        "azure_tenant_id": ""
    },
    "builders": [
        {
            "type": "azure-arm",
            "subscription_id": "{{user `azure_subscription_id`}}",
            "client_id": "{{user `azure_client_id`}}",
            "client_secret": "{{user `azure_client_secret`}}",
            "tenant_id": "{{user `azure_tenant_id`}}",
            "managed_image_resource_group_name": "packer",
            "location": "centralus",
            "os_type": "Linux",
            "image_publisher": "Canonical",
            "image_offer": "UbuntuServer",
            "image_sku": "16.04-LTS",
            "vm_size": "Standard_B1s",
            "managed_image_name": "petclinic"
        }
    ],
    "provisioners":[
        {
            "type": "shell",
            "script": "./deploypetclinic.sh"
        }
    ]
}

Immutable Infrastructure using Packer

Any Change means New Image

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner