none
How can one get a very detailed output for 'New-AzureRmVM' ? RRS feed

  • Question

  • The '-verbose' parameter adds just one line in the output of the 'New-AzureRmVM' command.

    "Performing the operation "New" on target "VMName"."

    It is not enough for a command that almost always runs >3 mins. Is there a way one can get a more verbose output for it. For eg. resource created, storage provisioned, booting up,  applying computer settings etc...


    Ayan Mullick Principal Infrastructure Engineer. British Petroleum.

    Monday, August 14, 2017 8:50 PM

All replies

  • Hello,

    To get started, first install the Azure CLI and connect to your Azure subscription.

    For current command syntax and options at the command line in Resource Manager mode, type azure help or, to display help for a specific command, azure help [command]. Also find CLI examples in the documentation for creating and managing specific Azure services.

    Optional parameters are shown in square brackets (for example, [parameter]). All other parameters are required.

    In addition to command-specific optional parameters documented here, there are three optional parameters that can be used to display detailed output such as request options and status codes. The -v parameter provides verbose output, and the -vv parameter provides even more detailed verbose output. The --json option outputs the result in raw json format.

    For more information, check this article Azure CLI commands in Resource Manager mode:
    https://docs.microsoft.com/en-us/azure/virtual-machines/azure-cli-arm-commands

    • Proposed as answer by Wayne.Yang Friday, August 18, 2017 2:12 AM
    • Unproposed as answer by Wayne.Yang Friday, August 18, 2017 2:14 AM
    Thursday, August 17, 2017 8:40 AM
  • Installed AzCli2.0 on Win10.

    'az vm create --resource-group cli --name myVM --image Win2012R2Datacenter' works

    'az vm create --resource-group cli --name myVM --image Win2012R2Datacenter -vw' 
    Error: az: error: unrecognized arguments: -v

    Same for 'vw'

    Same on the CloudShell on the Portal.


    Ayan Mullick Principal Infrastructure Engineer. British Petroleum.

    Thursday, August 17, 2017 5:56 PM
  • Hi

    You can use CLI to create VM and add "--verbose" in the end.

    Using CLI to login your Azure account.Then using these cmdlet:

    az group create --name myResourceGroup --location eastus
    az vm create --resource-group myResourceGroup --name myVM --image UbuntuLTS --generate-ssh-keys --verbose
    
    You will see the detail:
    Use existing SSH public key file: /home/yangsa/.ssh/id_rsa.pub
    Accepted: vm_deploy_VbDzQDgFpSuzV8dXCrfjklQW7DeoXWQQ (Microsoft.Resources/deployments)
    Accepted: myVMPublicIP (Microsoft.Network/publicIPAddresses)
    Accepted: myVMNSG (Microsoft.Network/networkSecurityGroups)
    Accepted: myVMVNET (Microsoft.Network/virtualNetworks)
    Succeeded: myVMPublicIP (Microsoft.Network/publicIPAddresses)
    Succeeded: myVMVNET (Microsoft.Network/virtualNetworks)
    Succeeded: myVMNSG (Microsoft.Network/networkSecurityGroups)
    Succeeded: myVMVMNic (Microsoft.Network/networkInterfaces)
    Accepted: myVM (Microsoft.Compute/virtualMachines)
    Succeeded: myVM (Microsoft.Compute/virtualMachines)
    Succeeded: vm_deploy_VbDzQDgFpSuzV8dXCrfjklQW7DeoXWQQ (Microsoft.Resources/deployments)
    
    Best regards!

    Friday, August 18, 2017 2:28 AM
  • OK.

    But just for the VM deployment it only repeats the same line a couple of more times. No additional details. 

    Accepted: myVM (Microsoft.Compute/virtualMachines)
    Succeeded: myVM (Microsoft.Compute/virtualMachines)
    Succeeded: myVM (Microsoft.Compute/virtualMachines)
    Succeeded: myVM (Microsoft.Compute/virtualMachines)
    Succeeded: myVM (Microsoft.Compute/virtualMachines)
    Succeeded: myVM (Microsoft.Compute/virtualMachines)

    Also the '--vw' and the '--jason switches don't work.  


    Ayan Mullick Principal Infrastructure Engineer. British Petroleum.

    Friday, August 18, 2017 3:13 PM
  • This would require more investigation and extensive troubleshooting. Hence, I would suggest you to contact technical support.

    --------------------------------------------------------------------------------------------------

    Do click on "Mark as Answer" on the post that helps you, this can be beneficial to other community members.

    Saturday, September 2, 2017 3:23 PM