从Azure Scale Set VM到Azure存储的代码同步 [英] Code sync from Azure Scale Set VM To Azure Storage

查看:72
本文介绍了从Azure Scale Set VM到Azure存储的代码同步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要帮助来纠正我面临的一个问题,即通过Azure自动缩放集功能(虚拟机缩放集)托管我的应用程序,当它受到很大的打击时,它将自动按比例放大,而当被击倒时,则为反向缩放,我还需要维护azure存储位置,因此在推送代码时,我需要从其中一台VM推送类似的代码到azure存储,如果我们拥有固定的VM名称,则可以使用azcopy将代码推送到azure存储,但是由于它具有自动缩放功能,因此我没有特定的VM名称.

简单来说,例如,当前池中有100个规模集服务器/虚拟机,我需要从这100个服务器之一中推送代码以从其中一台服务器中进行天青存储,而我没有该服务器的任何特定名称,这怎么可能???条件只有一次,我可以将代码从一台服务器推送到存储.

解决方案

您可以只使用

I need help to rectify one trouble which i am facing, am hosting my application through Azure auto scale set feature (virtual machine scale set) , when it get huge hit it will automatically scale up and an reverse when hit down, for that i need to maintain a azure storage location as well, so while push the code i need to push the similar code to azure storage from one of the VM , if we have fixed VM name we can use azcopy to push code to azure store but since its auto scale i don't have particular VM name.

simply for eg, currently there is 100 scale set servers/vm's are in pool i need to push code to azure storage from one of the server from that 100 and i dont have any particular name for that servers, how does it possible ??? condition is only one time i have push code to storage from one server.

解决方案

You can just use this PS command :

Get-AzVmssVM -ResourceGroupName <resource group name> -VMScaleSetName <VMSS name>

To get all instance names so that you can perform your copy logic. And refer to this post to retry the whole process in case of the instance that you picked get deleted while you copying data by your scaling rules.

If you want to get 1 VM from the VM list, you can just get the first one in the list as below:

$destVM = (Get-AzVmssVM -ResourceGroupName <group name> -VMScaleSetName <vmss name>)[0]

这篇关于从Azure Scale Set VM到Azure存储的代码同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆