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.
Related
I need to add a Windows B2s nodepool to AKS. I am getting the folowwing error:
Error: Code="VMSizeIsNotPermittedToEnableAcceleratedNetworkingForVmss" Message="Virtual machine at index 0 of VM scale set /removed id of VMSS/ has size Standard_B2s, which is not compatible with enabling accelerated networking in the network profile on the scale set. Allowed sizes: Standard_D2_v4, Standard_D2s_v4, Standard_D2ds_v4, etc.
I am sure before this was allowed because I had created B2s and B2ms Windows nodepools before. I see it is related to accelerated networking, but how can I influence accelerated netoworking for VMSS that is yet to be created and is controlled by Azure?
I have tested to add B2s in my environment with Linux nodepool and it was successful.
If your instance supports then it should be deployed with Accelerated Networking. If it does not, it should be deployed without AN. Please issue a support ticket if you can. And you can give these steps a try.
Create nodepool with AN supported instance type.
Scale nodepool to zero.
Change instance type to B2s.
Scale nodepool to one.
I shared a link below. Not the same thing but it also can give an idea.
https://github.com/Azure/AKS/issues/1404
Error: Code="VMSizeIsNotPermittedToEnableAcceleratedNetworkingForVmss"
Message="Virtual machine at index 0 of VM scale set /removed id of
VMSS/ has size Standard_B2s, which is not compatible with enabling
accelerated networking in the network profile on the scale set.
Allowed sizes: Standard_D2_v4, Standard_D2s_v4, Standard_D2ds_v4, etc
from the above error we can understand, VMSS/ has size Standard_B2s is not NotPermitted ToEnableAcceleratedNetworking.
You can check the same using this Az CLI cmdlet.
The list of Virtual Machine SKUs that support Accelerated Networking can be queried directly via the following Azure CLI az vm list-skus command.
az vm list-skus \
--location westus \
--all true \
--resource-type virtualMachines \
--query '[].{size:size, name:name, acceleratedNetworkingEnabled: capabilities[?name==`AcceleratedNetworkingEnabled`].value | [0]}' \
--output table
Would suggest you to select the node pool which is recommended one.
You can refer this MS Document for the same information.
Need some help figuring out the Azure CLI command and parameters to update cache setting of a live managed data disk attached to an Azure VM.
A managed data disk is created and attached to an Azure VM outside of my control. By default, Host caching is set to Read-Only. For some performance reasons, I would like to set Host caching to None for the attached data disk.
What did I try?
Tried to use below command
az vm update --subscription my-subscription --name my-vm-name --resource-group my-rgroup-name --disk-caching os=ReadWrite
This command updates the OS Disks Host cache setting. However, could not update managed disks setting. I tried different keys like managed, data-disks, attached, etc... instead of os in os=ReadWrite; Nothing worked, command throws ValueError
ValueError: invalid literal for int() with base 10: 'data-disks'
Explored another command - az disk update. However, it does not have option to update managed disk cache setting.
Tried to detach and re-attach the managed disk with --caching set to None. It works. However, this is not permitted in my case.
az vm disk detach --subscription my-subscription -g my-rgroup-name --vm-name my-vm-name --name managed-disk-name
az vm disk attach --subscription my-subscription -g my-rgroup-name --vm-name my-vm-name --name managed-disk-name --caching none
Need this for automation. So changing this setting from Azure portal UI is not an option.
Suggestions are much appreciated.
Without detaching the disk from virtual Machine using the below cmdlet to change the managed disk caching from ReadWrite\ReadOnly to None.
We have tested this cmdlet in our environment by creating a VirtualMachine & attached a Data disk to it and it is working fine.
Here is the Cmdlet:
az vm update --resource-group <resource-group-name> --name <vmName> --disk-caching os=ReadWrite 0(LunNumberOfTheDisk)=None
Here is the sample output screenshot for reference :
Below screenshot show the current state of disk caching before executing the above cmdlet.
In the below screenshot , you can see we have executed the cmdlet without stopping or detaching the disk from the virtual machine and the operation got succeeded without any interruption.
For the life of me, I can't work out what the differences are between Update-AzureRmVmss, Update-AzureRmVmssInstance and Update-AzureRmVmssVM in relation to Azure Resource Manager (AzureRM), even after reading the documentation.
https://learn.microsoft.com/en-us/powershell/module/azurerm.compute/update-azurermvmss?view=azurermps-6.13.0
I'm looking to run a command that will update all my VMs in my Azure VMSS (virtual machine scale set) regardless of the number of instances. The upgrade policy is set to manual.
You have many VM's in a scale set each VM is referred to as an instance.
In manual mode when you update the scale set model, nothing happens to existing VMs.
To update existing VMs, you must do a "manual upgrade" of each existing VM.
The powershell command is:
Update-AzVmssInstance -ResourceGroupName "myResourceGroup" -VMScaleSetName "myScaleSet" -InstanceId instanceId
You must run this command for each VM in your scale set.
If you want to upgrade all VM's with a single command you need to change the upgrade policy to automatic or rolling.
I want to create 70 VM's of the same OS in Azure. For this, I have created a VM converted to a custom image of it so that I can deploy 70 instances of this machine.
The issue here for me is if I deploy 70 instances of VM via custom images I am getting the hostname of all the VM's as same. All 70 VM's hostname is WIN2K12.
Is there any way where I can change this hostname while deploying?
I'm dealing with the same question right now and my solution is run a remote PowerShell command through Azure CLI (Linux shell in the example below) in the VMs that need to have their hostnames changed. Basically is something like this:
$RG = "Your Resource Group Name"
$OLD_NAME = "The replicated hostname name"
$NEW_NAME = "The new hostname"
$VM_NAME = "The VM's name that you just created/copied"
az vm run-command invoke \
--resource-group $RG \
--name $VM_NAME \
--command-id RunPowerShellScript \
--scripts "Rename-Computer -ComputerName $OLD_NAME -NewName $NEW_NAME"
I guess you can adapt it to get parameters from command line etc.
Don't forget to restart the VMs after this.
Point of clarification.
If you create VM from a Image they will not/should not have the same Hostname. Part of process of making an Azure Custom Image is to sysprep machine which guarantees the hostname will be different when you deploy new VM using that image.
https://learn.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource
In Azure the only time VM will get the same host name is if you create VM from a specialized disk, meaning create VM from a copy of the same disk (not really image).
The thing you have to confirm is if your applications on the VM allows sysprep.
Since you chose "NO" on SysPrep the image is not generalized. You're basically creating 70 copies of the same harddrive and starting them. Sysprep ensures that the server upon boot accepts either manual or scripted input to change hostname among other things.
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 :).