azure - 在多个区域的 Azure 中部署的优化方式?
问题描述
我正在多个区域的 Azure 中从 VHD 部署虚拟机。对于每个区域,我都在创建新的资源组和存储帐户,尽管用于创建图像的 VHD 文件是相同的。是否有任何优化方式来使用 Azure 中的资源?我可以在一个存储帐户中使用 blob 来在其他区域进行部署吗?
解决方案
您可以使用多种方式在 azure 中自动部署。arm 模板可能是最好的模板。对于未管理的磁盘,老实说,我不确定您是否可以使用 blob 的 arm 模板创建这些磁盘,但是您可以使用现有 blob 的非托管磁盘创建 vm:
{
"apiVersion": "2015-06-15",
"type": "Microsoft.Compute/virtualMachines",
"name": "[variables('vmName')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]",
"[resourceId('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
],
"properties": {
"hardwareProfile": {...},
"osProfile": {...},
"storageProfile": {
"imageReference": {
"publisher": "MicrosoftWindowsServer",
"offer": "WindowsServer",
"sku": "[parameters('windowsOSVersion')]",
"version": "latest"
},
"osDisk": {
"name": "osdisk",
"vhd": {
"uri": "[concat(reference(resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))).primaryEndpoints.blob, 'vhds/osdisk.vhd')]"
},
"caching": "ReadWrite",
"createOption": "FromImage"
},
"dataDisks": [
{
"name": "datadisk1",
"diskSizeGB": 1023,
"lun": 0,
"vhd": {
"uri": "[concat(reference(resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))).primaryEndpoints.blob, 'vhds/datadisk1.vhd')]"
},
"createOption": "Empty"
}
]
},
"networkProfile": {...},
"diagnosticsProfile": {...}
}
}
但我很确定,如果您想要托管磁盘并且可以从 blob uri 创建,则首先需要创建托管映像,但它们必须位于同一区域(映像和 blob)中。
推荐阅读
- ruby - Rails 5 Scheduling App 查找用户的所有班次
- python - 将通配符应用于 Pandas isin 过滤器
- excel - Excel:=SWITCH() 不适用于通配符 *
- javascript - 为什么这个文本字段会因 morphdom 而失去焦点?
- javascript - Vue2导出SVG元素以下载为文件
- java - 后备服务 spring Boot
- java - 在 jar 中找不到资源文件,但在 winrar 中打开时存在
- algorithm - 以 O(n) 复杂度对表进行排序
- ruby-on-rails - 使用 Rails 活动存储图像魔法裁剪图像时出错
- c - 为什么 mkdir() 和 rmdir() POSIX 系统调用在不同的头文件中?