如何通过ARM模板部署初始化/格式化Azure Windows VM的数据磁盘?

问题描述 投票:0回答:1

我正在尝试使用ARM模板部署Azure Windows VM。

尽管我已经设法将数据磁盘添加到模板中,但是我必须在磁盘管理中的OS级别上对其进行初始化。

在进行部署时,有没有一种方法可以自动初始化并格式化它们?

从中进行部署时,Azure门户如何执行?

azure arm-template azure-template
1个回答
0
投票

使用custom script extension,而所有这些都可以在Powershell中完成,例如

PS C:\>Get-Disk | Where-Object OperationalStatus -eq 'Offline'| 
         Initialize-Disk -PartitionStyle GPT -PassThru |
            New-Volume -FileSystem NTFS -DriveLetter F -FriendlyName 'New-Volume'

https://docs.microsoft.com/en-us/powershell/module/storage/new-volume?view=win10-ps

© www.soinside.com 2019 - 2024. All rights reserved.