Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ZRS disks in virtualdisk and manageddisk modules #855

Merged
merged 2 commits into from
Jun 8, 2022

Conversation

andreadecorte
Copy link
Contributor

SUMMARY

Fixes #792

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME
  • azure_rm_manageddisk
  • azure_rm_virtualmachine
ADDITIONAL INFORMATION

Added 2 tests. Note that ZRS are currently only supported in selected regions, so this test right now will fail in US East. I tested it successfully in West Europe

@Fred-sun
Copy link
Collaborator

Fred-sun commented May 23, 2022

@andreadecorte Please update the test case as follows, pipeline deploys the test region to be EATUS and does not support "StandardSSD_ZRS" and" Premium_ZRS"! I only changed what I wanted to update!Thank you very much!

Position 1:
 - name: Create new manged disk with  I(account_type=StandardSSD_ZRS)
   azure_rm_manageddisk:
       resource_group: "{{ resource_group }}"
       name: "md{{ rpfx }}4"
       storage_account_type: "StandardSSD_ZRS"
       disk_size_gb: 2
       location: westus2
   register: output
Position 2:
 - name: Create new manged disk with  I(account_type=Premium_ZRS)
   azure_rm_manageddisk:
       resource_group: "{{ resource_group }}"
       name: "md{{ rpfx }}5"
       storage_account_type: "Premium_ZRS"
       disk_size_gb: 2
       location: westus2
   register: output
Position 3:
 - name: Delete all managed disk
   azure_rm_manageddisk:
       resource_group: "{{ resource_group }}"
       name: "md{{ rpfx }}{{ item }}"
       managed_by: ''
       state: absent
   with_items:
       - 1
       - 2
       - 3
       - 4
       - 5  

@Fred-sun Fred-sun added enhancement New feature or request medium_priority Medium priority work in In trying to solve, or in working with contributors labels May 23, 2022
@andreadecorte
Copy link
Contributor Author

thanks for the review @Fred-sun , updated managed_disk test as per suggestion

@Fred-sun
Copy link
Collaborator

@andreadecorte Because some locations do not support the *_ZRS account type, please update the content of "azure_test_minimal_manageddisk.yml" as follows. Thank you very much!

- name: Create virtual network
  azure_rm_virtualnetwork:
    resource_group: "{{ resource_group }}"
    name: "{{ network_name }}-disk"
    address_prefixes: "{{ network }}"
    location: westus2

- name: Create subnet
  azure_rm_subnet:
    resource_group: "{{ resource_group }}"
    name: "{{ subnet_name }}"
    address_prefix: "{{ subnet }}"
    virtual_network: "{{ network_name }}-disk"

- name: Create network interface
  azure_rm_networkinterface:
    resource_group: "{{ resource_group }}"
    name: "{{ interface_name }}-disk"
    virtual_network: "{{ network_name }}-disk"
    subnet: "{{ subnet_name }}"
    location: westus2

- name: Create minimal VM with defaults and a custom managed disk type
  azure_rm_virtualmachine:
    resource_group: "{{ resource_group }}"
    name: "{{ vm_name }}"
    admin_username: "testuser"
    ssh_password_enabled: false
    managed_disk_type: StandardSSD_ZRS
    public_ip_allocation_method: Disabled
    location: westus2
    network_interface_names:
      - name: "{{ interface_name }}-disk"
        resource_group: "{{ resource_group }}"
    ssh_public_keys:
      - path: /home/testuser/.ssh/authorized_keys
        key_data: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfoYlIV4lTPZTv7hXaVwQQuqBgGs4yeNRX0SPo2+HQt9u4X7IGwrtXc0nEUm6LfaCikMH58bOL8f20NTGz285kxdFHZRcBXtqmnMz2rXwhK9gwq5h1khc+GzHtdcJXsGA4y0xuaNcidcg04jxAlN/06fwb/VYwwWTVbypNC0gpGEpWckCNm8vlDlA55sU5et0SZ+J0RKVvEaweUOeNbFZqckGPA384imfeYlADppK/7eAxqfBVadVvZG8IJk4yvATgaIENIFj2cXxqu2mQ/Bp5Wr45uApvJsFXmi+v/nkiOEV1QpLOnEwAZo6EfFS4CCQtsymxJCl1PxdJ5LD4ZOtP xiuxi.sun@qq.com"
    vm_size: Standard_B1ms
    virtual_network: "{{ network_name }}-disk"
    image:
      offer: UbuntuServer
      publisher: Canonical
      sku: 16.04-LTS
      version: latest
  register: vm_output

 - name: Assert status succeeded
   assert:
     that:
       - vm_output.changed

- name: Delete VM
  azure_rm_virtualmachine:
    resource_group: "{{ resource_group }}"
    name: "{{ vm_name }}"
    remove_on_absent: all_autocreated
    state: absent

@andreadecorte
Copy link
Contributor Author

thanks @Fred-sun , updated the test as per suggestion

@Fred-sun Fred-sun added ready_for_review The PR has been modified and can be reviewed and merged and removed work in In trying to solve, or in working with contributors labels May 25, 2022
@Fred-sun Fred-sun added ready_for_review The PR has been modified and can be reviewed and merged and removed work in In trying to solve, or in working with contributors labels May 25, 2022
Copy link
Collaborator

@Fred-sun Fred-sun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to change location and vm_size for service reasons

Co-authored-by: Fred-sun <37327967+Fred-sun@users.noreply.github.com>
@xuzhang3
Copy link
Collaborator

xuzhang3 commented Jun 8, 2022

@andreadecorte LGTM, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request medium_priority Medium priority ready_for_review The PR has been modified and can be reviewed and merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to create ZRS managed disk
3 participants