当快照位于另一个资源组中时,从快照创建VM
我使用Azure CLI命令从快照创建了VM 以下是从快照创建VM的脚本
az disk create -g $RD_OPTION_RESOURCEGROUP -n $RD_OPTION_DISKNAME --source $RD_OPTION_SNAPSHOTNAME
az vm create -g $RD_OPTION_RESOURCEGROUP -n $RD_OPTION_VMNAME --attach-os-disk $RD_OPTION_DISKNAME --os-type windows
此代码将创建Snapshot创建VM,其中快照位于一个资源组中,ABC表示ABC,那么新创建的VM也应该在同一资源组ABC中,
现在我需要像我这样找到的方式想要从快照和新创建的VM等快照创建VM,将在不同的资源组中……就像快照位于ABC资源组中,那么在另一个资源组中必须分配新创建的VM,请说XYZ,
请帮助我在此
I have created vm from snapshot using azure cli command
Below is the script for the creation of vm from snapshot
az disk create -g $RD_OPTION_RESOURCEGROUP -n $RD_OPTION_DISKNAME --source $RD_OPTION_SNAPSHOTNAME
az vm create -g $RD_OPTION_RESOURCEGROUP -n $RD_OPTION_VMNAME --attach-os-disk $RD_OPTION_DISKNAME --os-type windows
This code will create the vm from snapshot in which snapshot is in one resource group say abc then the newly creating vm should also in same resource group abc
now i need to find the way like i want to create a vm from snapshot like the snapshot and newly creating vm will be in different resource groups... like if snapshot is in abc resource group then the newly creating vm have to be allocated in the other resource group say xyz
Please help me out in this
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
sourcesubscriptionIdId
提供快照所在的订阅ID。sourcereSourceGroupName
在其中您必须在其中提供快照所在的资源组名称。快照名称
。订阅ID
在其中存在快照。快照ID
。targetResourceGroupName
在其中快照将复制到:将快照
复制到其他资源组在CMDLET下方:参考: azure-cli-samples/copy-snapshotsnapshot to-snapshot to-same-same-same-ordferty-subscription。 sh在主人·azure-samples/azure-cli-samples·github 。
sourceSubscriptionId
where you have to provide the subscription ID in which your snapshot resides.sourceResourceGroupName
where you have to provide the resource group name in which your snapshot resides.snapshot name
.subscription Id
where snapshot exists.snapshot ID
.targetResourceGroupName
where snapshot will be copied to:copy the snapshot
to different resource group try using the below cmdlet:Reference : azure-cli-samples/copy-snapshot-to-same-or-different-subscription.sh at master · Azure-Samples/azure-cli-samples · GitHub.