This repository has been archived by the owner. It is now read-only.

azure_rm_virtualmachine module fails creating a virtualmachine when the name of vm contains upper-case. #4174

Closed
h-hirokawa opened this Issue Jul 13, 2016 · 4 comments

Comments

Projects
None yet
5 participants
@h-hirokawa
Contributor

h-hirokawa commented Jul 13, 2016

ISSUE TYPE
  • Bug Report
COMPONENT NAME

azure_rm_virtualmachine

ANSIBLE VERSION
ansible 2.2.0 (devel 221520cbad) last updated 2016/07/13 15:32:29 (GMT +900)
  lib/ansible/modules/core: (detached HEAD db8af4c5af) last updated 2016/07/13 15:32:38 (GMT +900)
  lib/ansible/modules/extras: (detached HEAD 482b1a640e) last updated 2016/07/13 15:32:38 (GMT +900)
  config file =
  configured module search path = Default w/o overrides
CONFIGURATION

N/A

OS / ENVIRONMENT

N/A

SUMMARY

Creating a new azure virtualmachine with upper-cased letter fails without setting a specific storage account because AzureRMVirtualMachine.create_default_storage_account try to create a storage account with upper-case.
As described in this document, the storage account name can only use numbers and lower-case letters.

STEPS TO REPRODUCE

Here is a sample task.

- azure_rm_virtualmachine:
    name: nameWithUpper
    resource_group: Testing
    vm_size: Standard_D1
    public_ip_allocation_method: Dynamic
    admin_username: AdminUserName
    admin_password: AdminP@ssw0rd
    open_ports:
      - 3389
      - 5986
    os_type: Windows
    image:
      publisher: MicrosoftWindowsServer
      offer: WindowsServer
      sku: Windows-Server-Technical-Preview
      version: latest
EXPECTED RESULTS

The module should convert the vm name to lowercase before trying to create a default storage account.

ACTUAL RESULTS

Creating storage account always fails as below.

TASK [azure_rm_virtualmachine] *************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Failed to create a unique storage account name for nameWithUpper. Try using a different VM name."}

h-hirokawa added a commit to h-hirokawa/ansible-modules-core that referenced this issue Jul 13, 2016

chouseknecht added a commit that referenced this issue Jul 13, 2016

Merge pull request #4176 from h-hirokawa/fix4174
Fix azure_rm_virtualmachine to create a storage account with name contains lower-case only  (#4174).

@nitzmahone nitzmahone added this to the stable-2.1 milestone Jul 14, 2016

@ansibot

This comment has been minimized.

Show comment
Hide comment
@h-hirokawa

This comment has been minimized.

Show comment
Hide comment
@h-hirokawa

h-hirokawa Aug 1, 2016

Contributor

The fix has been already merged in eab6bb8.

Contributor

h-hirokawa commented Aug 1, 2016

The fix has been already merged in eab6bb8.

@h-hirokawa h-hirokawa closed this Aug 1, 2016

@brikr

This comment has been minimized.

Show comment
Hide comment
@brikr

brikr Apr 24, 2017

This error still occurs if the VM name has other characters in it that would be illegal in a storage account name (any special characters, etc.). Should this be re-opened and fixed all the way or is that another bug?

brikr commented Apr 24, 2017

This error still occurs if the VM name has other characters in it that would be illegal in a storage account name (any special characters, etc.). Should this be re-opened and fixed all the way or is that another bug?

@bnaydenov

This comment has been minimized.

Show comment
Hide comment
@bnaydenov

bnaydenov Aug 7, 2017

Storage account name should comply with Azure Storage Account limits:

  • Between 3 and 24 characters. Lowercase letters and numbers
  • Storage account names are scoped globally (across subscriptions).

Storage account name should comply with Azure Storage Account limits:

  • Between 3 and 24 characters. Lowercase letters and numbers
  • Storage account names are scoped globally (across subscriptions).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.