Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

Missing example for creating a specialized image version with azure_rm_galleryimageversion using storage_profile #89

Open
seflue opened this issue Jul 21, 2021 · 0 comments

Comments

@seflue
Copy link

seflue commented Jul 21, 2021

I really would appreciate an example how to create a specialized image version with Ansible. I'm trying that since two days without any success - but with Azure CLI it works.

This is essentially my ansible declaration:

    - name: Create a gallery image version form a managed image                              |~
      azure_rm_galleryimageversion:
        resource_group: "{{ resource_group }}"
        gallery_name: "{{ image_gallery }}"
        gallery_image_name: "{{ image_name }}"
        name: "{{ image_version }}"
        location: "{{ location }}"
        publishing_profile:
          end_of_life_date: ""
          exclude_from_latest: no
          replica_count: 2
          storage_account_type: Standard_LRS
          target_regions:
            - name: "{{ location }}"
              regional_replica_count: 1
        storage_profile:
          source_image: "/subscriptions/{{ subscription }}/resourceGroups/{{ resource_group }}/providers/Microsoft.Compute/virtualMachines/{{ vm }}"

Especially the following error message is not helpful:

Error creating the GalleryImageVersion instance: Azure Error: InvalidParameter
Message: The gallery artifact version source can only be specified either directly under storageProfile or within individual OS or data disks. One and only one source type (user image, snapshot, disk, virtual machine) can be provided.
Target: galleryImageVersion.properties.storageProfile.source.id

And the documentation on that does not help at all:

Message: The gallery artifact version source can only be specified either directly under storageProfile or within individual OS or data disks. One and only one source type (user image, snapshot, disk, virtual machine) can be provided.
Cause: The source ID is missing.
Workaround: Ensure that the source ID of the source is present.

The examples on that are outdated, because they're using "managed_image" which is depricated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant