0

Suppose Ive created a scale set from an image, which has 5 VM's in it.

Now suppose i have an update for my application, how do i push this update, such that the image is updated with the latest application code and the updates is pushed to all the Current Running Vm's in the ScaleSet, also next time ScaleSet brings up new vm's it would do so using the updated IMAGE

Thank You

avshetty
  • 11
  • 1
  • 4

1 Answers1

2

If you are using a custom image you would do something like this:

$rgname = "resourceGroupName"
$vmssname = "vmssName"
$instanceid = "1" # How Many instances we update simultaneously

$vmss = Get-AzureRmVmss -ResourceGroupName $rgname `
  -VMScaleSetName $vmssname
$vmss.virtualMachineProfile.storageProfile.osDisk.image.uri `
  = $newURI #update image URI
Update-AzureRmVmss -ResourceGroupName $rgname -Name $vmssname `
  -VirtualMachineScaleSet $vmss # push changes
Update-AzureRmVmssInstance -ResourceGroupName $rgname `
  -VMScaleSetName $vmssname -InstanceId $instanceId # start update

So in general you need to supply new or updated image to the VMSS and then invoke an update.

Some reading:
https://msftstack.wordpress.com/2016/05/17/how-to-upgrade-an-azure-vm-scale-set-without-shutting-it-down/

4c74356b41
  • 69,186
  • 6
  • 100
  • 141
  • Hi thanks for your reply, what you have mentioned above is updating the OS, i was inquiring about updating my application files that i have been installed on the server. how do i push new files to my application folder and how can this be done to all vm's in a scale set. Instead of creating a new image each time i need to push a minor update to the vm – avshetty Jun 19 '17 at 05:08
  • well, logically this is how you do it. or use configuration management tools (DSC\ansible\puppet\etc). because scale sets are not meant to be administered by rdp. easiest way is updating the image (you really should have a ci\cd pipeline for that, so there's 0 effort in doing that) or update vm extension – 4c74356b41 Jun 19 '17 at 07:22