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

az vm create --image validation incorrectly suggesting --use-unmanaged-disk #6897

Closed
iyerusad opened this issue Jul 26, 2018 · 1 comment
Closed
Assignees
Milestone

Comments

@iyerusad
Copy link

iyerusad commented Jul 26, 2018

Describe the bug

az vm create --image is doing a poor job at validating and expressing need for --use-unmanaged-disk. If valid URI, it suppress the need for that flag, if invalid URI it suggests unmanaged disk is needed (where the real problem is invalid URI).

It seems az vm create --image shouldn't validate whether --use-unmanaged-disk is required. It seems to default to that if unknown/invalid URI. Somehow it knows a valid URI so perhaps there is a missing check here somewhere.

To Reproduce

  1. az vm create -n "blahblah" -g "blahrsg" --size "Standard_DS5_v2_Promo" --image "MicrosoftWindowsDesktop:Windows-10:latest"

Confusing and misleading error message (tells me I want unmanaged disks... no i don't):

invalid usage for storage profile: create unmanaged OS disk created from generalized VHD:
        missing: --os-type, --use-unmanaged-disk
  1. Ok lets play along and try this:
    az vm create -n "blahblah" -g "blahrsg" --size "Standard_DS5_v2_Promo" --image "MicrosoftWindowsDesktop:Windows-10:latest" --use-unmanaged-disk --os-type "windows"
    This error message tells me what the first command should of told me:
Deployment failed. Correlation ID: 3225ef51-8598-46fa-98c8-f6cfaa969b61. {
  "error": {
    "code": "InvalidParameter",
    "target": "osDisk.image.uri",
    "message": "The URI microsoftwindowsdesktop:Windows-10:latest does not look to be correct blob URI."
  }
}
  1. Lets identify the correct blob URI:
    az vm image list --offer Windows-10 --all --output table
Offer       Publisher                Sku       Urn                                                       Version
----------  -----------------------  --------  --------------------------------------------------------  ------------
Windows-10  MicrosoftWindowsDesktop  RS3-Pro   MicrosoftWindowsDesktop:Windows-10:RS3-Pro:16299.431.41   16299.431.41
Windows-10  MicrosoftWindowsDesktop  RS3-Pro   MicrosoftWindowsDesktop:Windows-10:RS3-Pro:16299.492.43   16299.492.43
Windows-10  MicrosoftWindowsDesktop  RS3-Pro   MicrosoftWindowsDesktop:Windows-10:RS3-Pro:16299.551.46   16299.551.46
Windows-10  MicrosoftWindowsDesktop  RS3-ProN  MicrosoftWindowsDesktop:Windows-10:RS3-ProN:16299.431.41  16299.431.41
Windows-10  MicrosoftWindowsDesktop  RS3-ProN  MicrosoftWindowsDesktop:Windows-10:RS3-ProN:16299.492.43  16299.492.43
Windows-10  MicrosoftWindowsDesktop  RS3-ProN  MicrosoftWindowsDesktop:Windows-10:RS3-ProN:16299.551.46  16299.551.46
Windows-10  MicrosoftWindowsDesktop  rs4-pro   MicrosoftWindowsDesktop:Windows-10:rs4-pro:17134.112.43   17134.112.43
Windows-10  MicrosoftWindowsDesktop  rs4-pro   MicrosoftWindowsDesktop:Windows-10:rs4-pro:17134.167.46   17134.167.46
Windows-10  MicrosoftWindowsDesktop  rs4-pro   MicrosoftWindowsDesktop:Windows-10:rs4-pro:17134.48.41    17134.48.41
Windows-10  MicrosoftWindowsDesktop  rs4-pron  MicrosoftWindowsDesktop:Windows-10:rs4-pron:17134.112.43  17134.112.43
Windows-10  MicrosoftWindowsDesktop  rs4-pron  MicrosoftWindowsDesktop:Windows-10:rs4-pron:17134.167.46  17134.167.46
Windows-10  MicrosoftWindowsDesktop  rs4-pron  MicrosoftWindowsDesktop:Windows-10:rs4-pron:17134.48.41   17134.48.41
  1. Now that I know the cryptic SKU rs4-pro is what I am looking for I can now craft the appropriate spell:
    az vm create -n "blahblah" -g "blahrsg" --size "Standard_DS5_v2_Promo" --image "MicrosoftWindowsDesktop:Windows-10:rs4-pro:latest"
{created VM}

Expected behavior

  1. az vm create -n "blahblah" -g "blahrsg" --size "Standard_DS5_v2_Promo" --image "MicrosoftWindowsDesktop:Windows-10:latest"

Informative error:

"message": "The URI microsoftwindowsdesktop:Windows-10:latest does not look to be correct blob URI."

Environment summary
Azure Shell - Bash.

Additional context
Why I am here today: Windows-10 SKU selection should not be so complex.

The default image SKUs include Ubuntu, UbuntuLTS, WindowsServer2012 etc.... why not Windows10?

Ultimately what I really am looking for today was an easy way to spin a standard Window10 VM, without having to lookup specific URIs or other nonsense: az vm create -n "blahblah" -g "blahrsg" --size "Standard_DS5_v2_Promo" --image "Windows10"

@yugangw-msft yugangw-msft self-assigned this Jul 26, 2018
@yugangw-msft
Copy link
Contributor

The image type detection and error can be improved for sure. We assumed users should just copy and paste the urn from the output of az vm image list, but looks like the urn could get manually edited.

@yugangw-msft yugangw-msft added the Compute az vm/vmss/image/disk/snapshot label Jul 27, 2018
@adewaleo adewaleo self-assigned this Oct 26, 2018
@adewaleo adewaleo added this to the Sprint 48 milestone Oct 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants