Azure vmss without a load balancer - azure

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 :).

Related

Updating Azure Virtual Machine Scale Set

I have hosted a website in azure virtual machine scale set by following the below steps
Create a VM and do the necessary changes/installations in iis.
Create a snapshot of the VM. This ensure that the above instance can be used for future changes.
create a disk from the snapshot.
create a vm from the disk.
RDP to the instance and generalize the instance for deployment (sysprep)
Run %WINDIR%\system32\sysprep\sysprep.exe as admin.
Enter System Out-of-Box Experience (OOBE),
Generalize check box is selected
Shutdown Option = Shutdown
Create Image (capture) from the above instance.
Create VSS from the above image
Suppose their is a change in the web build , Is there a way to update the scale set without following these steps again ?
Azure virtual machine extensions provide capabilities such as post-deployment configuration and management, monitoring, security, and more. Production deployments typically use a combination of multiple extensions configured for the VM instances to achieve desired results.
This is also is a good way to ensure availability of your system. The scale set will apply the update to one VM at a time, leaving the other VMs up and running.
Below example taken from the learn:
Deploy the update by using a custom script extension
In the Azure portal, run the following command to view the current upgrade policy for the scale set:
Azure CLI:
az vmss show \
--name webServerScaleSet \
--resource-group scalesetrg \
--query upgradePolicy.mode
Verify that the upgrade policy is set to Automatic. You specified this policy when you created the scale set in the first lab. If the policy were Manual, you would apply any VM changes by hand. Because the policy is Automatic, you can use the custom script extension and allow the scale set to do the update.
Run the following command to apply the update script:
az vmss extension set \
--publisher Microsoft.Azure.Extensions \
--version 2.0 \
--name CustomScript \
--vmss-name webServerScaleSet \
--resource-group scalesetrg \
--settings "{\"commandToExecute\": \"echo This is the updated app installed on the Virtual Machine Scale Set ! > /var/www/html/index.html\"}"

how to disable Accelerated Networking on Azure VM

i have enabled Accelerated Networking on Azure Vm..now i want to disable accelerating networking but unable to find a way. since i want to change the size of vm and accelerating network is preventing to change the size.
please suggest
This is a setting on the network interface. For a single machine you could try running this command from the cloud shell on the azure portal:
az network nic update --accelerated-networking false --name <network interface name> --resource-group <resource group name>
Recommend typing this command out not copy pasting from this page to avoid hyphen hell. Case sensitive so all lower case.
https://learn.microsoft.com/en-us/cli/azure/network/nic?view=azure-cli-latest#az-network-nic-update
For VMSS (Virtual Machine Scale Sets), the process is a bit less straight forward, but still possible.
Say your resource group is RG001 and the VMSS name is VMSS001, then you can issue
az vmss update -g RG001 -n VMSS001 --set virtualMachineProfile.networkProfile.networkInterfaceConfigurations[0].enableAcceleratedNetworking=false
I added a new NIC from the VM networking tab and it seems that accelerated networking is disabled by default. Then I detach the previous NIC (with accelerated networking) and was able to resize my VM.
You could try to use azure powershell to do it.
Remove-AzureRmAcceleratedNIC -ResourceGroupName <ResourceGroupName> -VMName <VMName> -OsType <OsType>
You need to download the script file in this link, then refer to the usage below.
For more details, refer to this link.

Azure Kubernetes on different network?

I've setup kubernetes in azure using the azure acs and the azure cli.
az account list
az account set --subscription foobar
az group create --name foobar --location westus
az acs create --orchestrator-type=kubernetes --resource-group foobar --master-count 1 --name=foobar --dns-prefix=foobar
I want to be able to setup a site to site vpn, so that kubernetes can reach internal services in my datacenter.
Unfortunatly azure acs sets up kubernetes on a 10.0.0.0 network which overlaps with other resources in azure and my datacenter.
I can't find any way to change which subnet kubernetes runs on in acs. Is there a way to change the prefered network?
There does not appear to be a way to choose network from the acs create command
az acs create --name
--resource-group
[--admin-password]
[--admin-username]
[--agent-count]
[--agent-vm-size]
[--client-secret]
[--dns-prefix]
[--generate-ssh-keys]
[--location]
[--master-count]
[--no-wait]
[--orchestrator-type {Custom, DCOS, Kubernetes, Swarm}]
[--service-principal]
[--ssh-key-value]
[--tags]
[--validate]
[--windows]
No, there's no way of doing that. There might be a way to create a new kubernetes to existing vnet, but I'm not aware of that.
Your another option would be to delete all vm's and recreate them in the new vnet. No guarantee it would work.
With ACS through its CLI you can specify subnet id so the acs is created in a particular VNET. However this is only available in certain regions

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 create a VM with multiple NIC's in Azure ARM

Has anyone been able to create a VM with multiple private IP's in ARM? I've tried setting different VM sizes but still cannot find out how to attach multiple NIC's to 1 VM. I'm trying to do this in the new ARM mode but cannot find a way to do so.
Thanks!
You can only add multiple network interface resources to a VM using PowerShell or JSON, and it can only be done during VM creation.
The nics have to have been created before hand and you have to choose a vm which supports multiple NICs. Also, Create a virtual network with one subnet must have been created before hand as well.
Using Azure Cli 2.0
azure login
azure config mode arm
azure vm create -g myresourcegroup -n myVMname -l AzureLocation -y {windows|linux} -N myNic1, myNic2 -Q Win2012R2Datacenter -u myUserName -p myPassword -z ‘AzureVM Size’ -v
Wait 5 minutes
and you are done

Resources