我正在尝试通过Azure Powershell 1.0将Puppet代理添加到已经存在的Azure VM中。官方文档涉及以下内容的使用:
Parameter Set: SetPuppetExtension
Set-AzureVMPuppetExtension [-PuppetMasterServer] <String> [[-Version] <String> ] [[-Disable]] [[-ReferenceName] <String> ] -VM <IPersistentVM> [ <CommonParameters>]
我正在尝试通过get-AzureRmVm(BTW返回VM的详细信息)从Azure中获取-VM参数,但是set-AzureVMPuppetExtension没有它:
Set-AzureVMPuppetExtension : Cannot bind parameter 'VM'. Cannot convert the "$VM" value of type "System.String" to type
"Microsoft.WindowsAzure.Commands.ServiceManagement.Model.IPersistentVM".
您遇到的问题是,Set-AzureVMPuppetExtension
预计从输出Get-AzureVM
不Get-AzureRmVm
这是旧的服务模型,经典的VM,做事方式。现在,它变得非常复杂。
首先找到您想要使用的扩展名
Get-AzureRmVMImagePublisher -Location $location
然后您可以使用
Get-AzureRmVMExtensionImageType -PublisherName puppetlabs -Location $location
这将为您提供您需要使用的详细信息
Set-AzureRmVMExtension
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句