I have a couple of storage accounts in my Azure subscription. I know my VMs are using them because when I look at the Boot diagnostics blade for those VMs in the portal, I can see a diagnostic screenshot and a serial log (apparently the storage account is where this information is held). However, I’ve looked high and low and can’t find the setting that specifies which storage account is being used by which VM.
I also tried the Powershell script mentioned in
Powershell to List Azure VMs with storage account name. However, any field in the output that relates to a storage account is empty.
Can someone please point me in the right direction?
Thanks
If you mean the storage account for the VM diagnostic, then you can get the storage account URL with the command Get-AzVM like this:
$vm = Get-AzVM -Name vmName
$vm.DiagnosticsProfile.BootDiagnostics
Here it shows you the URL of the storage account that stored the VM diagnostic logs, but this is the only thing you can find in the VM. If you want to get more details about the storage account, just run the command Get-AzStorageAccount.
I actually want to know which storage account the VMs are using.
I ran the Powershell that you suggested both at my workstation and in the Azure shell console. However, even though the Enabled property returned True, nothing was returned for the StorageUri property (hopefully the image that I pasted into this reply will show this).
As per the pasted image, I also ran an Az command that did return a couple of URIs (one for the boot image and one for the serial log).
However, I don't believe that this information will lead me to discover which storage account is being used. Any other suggestion you can offer will be appreciated.
enter image description here
Related
In TFS I selected Azure VMs File Copy:
My machine is classic and I created classic storage account. I set up the connection using username and password, not management certificate.
The storage account and cloud service I had to populate myself, because they did not appear in the drop-down menu (so possibly something is wrong already at this stage).
In the Cloud Service I entered MyMachine.cloudapp.net.
The task starts, it seems to login successfully, but throws:
Unable to find type [Hyak.Common.CloudException]
Log:
2017-11-24T14:21:28.80333Z Add-AzureAccount -Credential $psCredential
2017-11-24T14:21:35.866333Z Select-AzureSubscription -SubscriptionId -Default
2017-11-24T14:21:35.882333Z Set-AzureSubscription -SubscriptionId yy -CurrentStorageAccountName yyy
2017-11-24T14:21:35.898333Z ##[debug]Starting Azure File Copy Task
2017-11-24T14:21:35.898333Z ##[debug]connectedServiceNameSelector = ConnectedServiceName
2017-11-24T14:21:35.898333Z [debug]connectedServiceName = yyyyyy
(..)
2017-11-24T14:21:35.991333Z ##[debug]Loading AzureUtilityLTE9.8.ps1
2017-11-24T14:21:36.007333Z ##[debug]Connection type used is
UsernamePassword
2017-11-24T14:21:36.022333Z ##[debug]Azure
CallRetrieving storage key for the storage account:
mystorageaccount
2017-11-24T14:21:38.924333Z ##[error]Unable to find type
[Hyak.Common.CloudException].
Please help.
Actually you don't need to manually type the storage account, it will auto appear in the drop list. You just need to specify a pre-existing classic storage account. It is also used as an intermediary for copying files to Azure VMs.
Classic Storage Account
Required if you select Azure Classic for the Azure Connection Type
parameter. The name of an existing storage account within the Azure
subscription.
According to your log, the issue may related to the storage account setting. Double check this configuration under your Azure subscription.
Also suggest you go through this documentation to get more info of the Azure File Copy task. Such as make sure the machine should configured to allow WinRM connections.
I'm looking for a Powershell Azure Resource Manager (not Classic) version of this Stack Overflow Question
I am trying to find the available VM Sizes per subscription, not per region. I have two Azure subscriptions, one from MSDN, and one not. The Subscription from MSDN allows me to create DS2 v2 VMs, but the other one does not allow me to create any DS2 machines (even though I am also creating these machines in WestUS), so I have to use an L4. Apparently, this has something to do with what Microsoft calls a "tier".
I would like to know how to find all the available VM sizes in a subscription using the new ARM Powershell commands, if possible.
Alternatively, if there is a way to see a list of available VM sizes per subscription in the portal, that would also work.
I have tried to get this info using the following script:
Add-AzureRmAccount
Set-AzureRmContext -SubscriptionId $subscriptionID
Get-AzureRoleSize
But I get an error message ("No default description has been designated"). I suspect that this is because I am mixing ARM and ACM Powershell commands.
I have two Azure subscriptions, one from MSDN, and one not. The
Subscription from MSDN allows me to create DS2 v2 VMs, but the other
one does not allow me to create any DS2 machines (even though I am
also creating these machines in WestUS), so I have to use an L4.
By default, Azure supports 20 cores per region. You could use Get-AzureRmVMUsage -Location yourregion to check.
If you want to raise the limit or quota above the Default Limit, open an online customer support request at no charge. The limits can't be raised above the Maximum Limit value.
You also could see a list of available VM sizes per subscription in the portal.
Subscription-->Usage + quotas
Also, you could refer to this question.
Update:
If your cores does not reach all limit, it seems DsV2 SKU is not avilaibe in your subscription, please refer to this link to solve this issue.
In Azure Resource Manager (ARM) you can create a Virtual Image from a given VM with command Save-AzureRmVMImage. That command has this parameter:
-DestinationContainerName < String >
Specifies the name of a container. The virtual hard disks (VHDs) that
constitute the VMImage reside in the container that this parameter
specifies. If the VHDs are spread across multiple storage accounts,
this cmdlet creates one container that has this name in each storage
account.
But I am using Classic Service Mode (ASM) and the command Save-AzureVMImage doesn't have that parameter.
So my questions are:
Is it possible to indicate Azure where to store that VM Virtual Image? Any workaround?
Bonus question: Where is that ASM VM Virtual Image stored?
Answer to your 1st question - It is not possible to specify where in classic VM Virtual Images.
Answer to your 2nd question - When you create a classic VM you select a storage account. The images are stored in the same storage account as VM. If you go to that Storage account -> containers-> vhds. you can see them.
If you have not specified any storage account while creating a VM, it will use an auto generated account.
If you want your image to go a specific storage account, you have to first create it and specify it while creating your VM.
I want to deploy a VM in microsoft's azure with a new size.
Usually I use a json template for the vm with size 'Standard_DS3'
Now I would like to have another one with size a3 'A3', but this causes an error
statusMessage:{"error":{"code":"InvalidParameter","target":"vmSize","message":"The value of parameter vmSize is invalid."}}
So I was wondering where can I find valid vm sizes for deployments in a location and the correct name for the deployment with a template file?
One can list all vm-sizes available in specific location(e.g westus) from Azure CLI 2.0 using following command
az vm list-sizes --location "westus"
Since you mentioned json templates in your question then I assume that you are using Azure Resource Manager to provision resources. If that's the case, you can use the following REST API endpoint to list all available virtual machine sizes in a region.
https://management.azure.com/subscriptions/{subscription-id}/providers/Microsoft.Compute/locations/{location}/vmSizes?api-version={api-version}
This information is accessible using Azure CLI, i.e.: az vm list-sizes --location "eastus"
You can also reference Microsoft documentation to see the list of virtual machine sizes. Sounds like you need to use the "Large" size in your template to provision an A3 Standard VM.
This isn´t always true. I´ve got into a situation where this command gives me a VM size that wasn´t truely avalaible for my location. This is a known issue of the Azure CLI.
Here is the statement from Azure support:
Cause: It is known that the command az vm list-sizes can expose sizes that are actually unavailable and we are working on that situation.
Resolution: The best option is to mitigate this is to cross check the information provided by that query with the restrictions that you have in the subscription that can be analyzed by the command az vm list-skus. For your scenario, you can see the SKU restrictions in West Europe by using the following:
az vm list-skus --location WestEurope --output table
You can use Get-AzureRmVMSize commandlet in PowerShell. This doesn't change too often and I have a .NET library which contains a snapshot of those https://github.com/aloneguid/microsoft-azure-strongtyped
I am trying to upload a VHD using the syntax below:
csupload Add-PersistentVMImage –Destination "<BlobStorageURL>/<YourImagesFolder>/<VHDName>" -Label <VHDName> -LiteralPath <PathToVHDFile> -OS Windows
I am assuming the <BlobStorageURL> can be seen in the portal and is http://xx.blob.core.windows.net/ where "xx" has been replaced with the real subdomain. BUT, please can someone explain where I can create or get <YourImagesFolder> from?
Kind Regards,
Chris
The xx is the name of your storage account, and the *.blob.core.windows.net URL points to the blob storage of that account (besides blob storage your account also contains queues and table storage).
Follow this guide to create a new storage account in the new Windows Azure Portal: Create a Windows Azure Storage Account