Azure VMSS instance "Latest model" meaning - azure

When I look into my VMSS in Azure, and enters the "instances" blade, for each instance there is a property "Latest model" which can be either "No" or "Yes".
What does this property mean? I couldn't find any documentation about it.

The Latest Model inside the VMSS instances blade is know as the Latest Scaleset Model.
If it is Yes, then its the latest scaleset model and vice versa for No. There are couple of ways to change it to Yes i.e. Manual , Automatic and Rolling which can be set from the upgrade policy blade of the VMSS .
In Manual you will have to run the below command to update the scaleset model:
Azure CLI :
az vmss update-instances --resource-group myResourceGroup --name myScaleSet --instance-ids {instanceIds}
Output :
Before Update:
Only Update the last one with instance ID = 8 :
Update the remaining two by giving space separated instance id's:
For More details on Modify Scaleset Model you can refer this Microsoft Documentaion.

Related

Azure VMSS 10 model limit?

Recently when I update my VMSS model, I received error like
MyVmssName has reached its limit of 10 models that may be referenced
by one or more VMs belonging to the Virtual Machine Scale Set. . Upgrade the VMs to the latest model of the Virtual Machine Scale Set before trying again.
Does Azure have some official documentation on this 10 model limitation? Could not find it anywhere.
I have referred similar Issue:
When a change is made to the VMSS, such as a cluster upgrade, the change must be applied to the existing instances.
If VMSS using the manual upgrade policy. This means that when a change is made, the user must manually update the old instances.
Azure Portal > Impacted VMSS > Instances tab.
The CX can then select each instance which is showing Latest Model as No and upgrade one by one. I would not recommend upgrading all instances at once as this may bring the VMSS down.
Also upgrade VMSS instances using Azure CLI.
if VMSS upgrade policy is set to automatic, instances will upgrade automatically in random order.
You can also upgrade VMSS using Azure CLI.
az vmss update --name <VMSSName> --resource-group <ResourceGroupname> --license-type windows_server
Reference: Update VMSS

List databases in a CosmosDB instance using the AZ command line

I'm attempting to list all Databases from a CosmosDB instances using the AZ command line -
az account set --subscription $subscriptionId
az cosmosdb database list --name $cosmosName --resource-group $resourceGroup
The above command is resulting the following response -
Operation Failed: Resource Not Found
When adding the --debug argument I'm presented with the above error as well as the below detail -
Status code: 404
{"code":"NotFound","message":"Entity with the specified id does not exist in the system.\r\nActivityId: d5383919-7c23-4158-bded-2c623d55ab9b, Microsoft.Azure.Documents.Common/2.0.0.0"}
The CosmosDB that I am attempting to query absolutely does exist, derived by running the command az cosmosdb list, and I copied the SubscriptionId and ResourceGroup directly from the portal.
The MS docs and the command az cosmosdb database list --help both seem to suggest what I'm doing should work.
Can anyone suggest what I could do to fix the issue?
This error can happen if the PC where you are running Azure CLI doesn't have network connectivity to the CosmosDB account. To verify if this is the problem, please go to Portal.Azure.com > CosmosDB account > Firewall and Virtual Networks and if the firewall is enabled, add your current IP address.
I had same problem today, and I found firewall is the problem, adding client public IP will fix it, but there is another tricky part, it will take some time even after the firewall rule is updated in Azure portal ( for me I think it's 5~ 10 minutes ). I guess the rule need to be deployed to different location and it take longer time depending on which region you hit.
So you probably just need to be a bit more patient after updated firewall rule.
Also be aware, az allow three different options:
(1) resource group name and account name
(2) account name and key
(3) url-connection and key
I have found only 1 and 3 work, (2) will give me a error:
unsupported operand type(s) for +: 'NoneType' and 'str'
both "az cosmosdb database show" and "az cosmosdb database list" have same issue. the version I am using is azure-cli (2.0.45).

Azure vmss without a load balancer

My requirement is to scale vm instance (linux based custom image) based on CPU usage. Tried to follow steps mentioned in VMSS (virtual machine scale sets : https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-linux-autoscale), but it creates a LB in front which we don't want. Is it possible to avoid LB in vmss ?
If VMSS without LB is not the option, is there any other way in azure to do this ?
I am able to achieve this in AWS (using autoscale group) and GCP (instance group), so trying to get similar functionality in Azure.
hp
In powershell to make this work you need to provide both double quotes wrapped in single quotes: --load-balancer '""'
az vmss -n myName -g myGroup --load-balancer '""' --image UbuntuLTS
Pass empty id as a load-balancer
az vmss create -n myname -g mygroup --load-balancer "" --public-ip-per-vm --image UbuntuLTS
Though a load balancer is created when you create a VM scale set in the portal, other modes supporting external connectivity to scale sets include:
Create a separate VM with a public IP address in the same VNET as the scale set which can route connections to the scale set VMs (also known as a jump box). E.g. https://github.com/Azure/azure-quickstart-templates/tree/master/201-vmss-windows-jumpbox or https://github.com/Azure/azure-quickstart-templates/tree/master/201-vmss-linux-jumpbox
Assign a public IP address to each VM in the scale set. This feature is currently in limited preview. See here for more details: https://github.com/gbowerman/azure-myriad/tree/master/publicip-dns
Public IP per VM in a scale set is not supported today but is on the roadmap. If you submit a support request (e.g. from the question mark in the top-right of the azure portal), we can keep you informed on the timeline :).

How to change the number of target instances in an Azure Virtual Machine Scale Set?

I've created an Azure VMSS and used a target instance count of 1 during my testing. Now that I'm ready to go live for my customer, I really need to change the target instance count to at least 2 for HA reasons. Is there a way to do this via Azure CLI or other means without having to rebuild everything?
Is there a way to do this via Azure CLI or other means without having
to rebuild everything?
Yes, we can use Azure Resource Explorer to configure and update the autoscale setting for a scale set. Azure Resource Explorer is an easy way to manage Azure resources via Resource Manager templates. Here are my steps:
1. login Azure Resource Explorer.
2. switch Read Only to Read/Write.
3. select subscription and resource group, find the vmss and autoscalesettings, then edit it.
4. After edit is complete, select PUT.
5. Then we can find the result from Azure protal.
More information about configure and update the autoscale setting for a scale set, refer to the link.
You can change the capacity of a VM Scale set in the following ways:
Use the Azure portal - Click on your VM scale set and then select the Scaling blade. Use the slider bar.
Use the CLI 2.0 az vmss scale command.
Using Azure PowerShell 5.0.0 or later use this command:
Update-AzureRmVmss -ResourceGroupName myrg -VMScaleSetName myvmss -SkuCapacity 3

How to get a list of available vm sizes in an azure location

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

Resources