Set-AzureRMVMAccessExtension 对于 Linux
Set-AzureRMVMAccessExtension for Linux
我想以编程方式更改 Azure 中的 Linux VM 密码。 Set-AzureRMVMAccessExtension 的文档让我认为这可行,但它会无休止地挂起。
Set-AzureRmVMAccessExtension -ResourceGroupName $vm.ResourceGroupName -Credential (Get-Credential) -VMName $vm.Name -Name 'test' -Location $vm.Location
这开始执行,在该 VM 的 Azure VM 扩展 blade 中,我可以看到 'test' 已创建,但它处于 'Unavailable' 状态。我是否缺少参数或前一步?
如果重要的话,Linux VM 是最新的 RHEL。
好像和虚拟机的OS有关。如果我使用 Windows Server 2016 VM,我 运行 下面的命令。
$vmName = 'vmName '
$resourceGroupName = 'resourceGroupName '
$vm = Get-AzureRmVm -Name $vmName -ResourceGroupName $resourceGroupName
$credential = Get-Credential
Set-AzureRmVMAccessExtension -ResourceGroupName $vm.ResourceGroupName -Credential $credential -VMName $vm.Name -Name 'test' -Location $vm.Location
它添加了一个 Extension,它的 STATUS
首先是 Unavailable
,然后我在门户中重新启动 VM,它工作正常。另外,如果我们使用 $vm | Restart-AzureRmVM
,我想我们会得到相同的结果。
如果我使用 最新的 RHEL Linux VM,该命令将无休止地 运行,但我可以看到扩展已创建,状态为不可用 在门户中。但是重启虚拟机后,扩展不见了。
根据此 article,Set-AzureRMVMAccessExtension
似乎适用于 windows
。
Azure VMs generally have a small piece of software installed on them called a VM agent. This small agent is installed on the underlying Windows OS and communicates with Azure to allow the user control over the OS without necessarily touching the OS itself.
如果可以,我推荐你使用Azure CLI访问,你可以参考这个article.
我想以编程方式更改 Azure 中的 Linux VM 密码。 Set-AzureRMVMAccessExtension 的文档让我认为这可行,但它会无休止地挂起。
Set-AzureRmVMAccessExtension -ResourceGroupName $vm.ResourceGroupName -Credential (Get-Credential) -VMName $vm.Name -Name 'test' -Location $vm.Location
这开始执行,在该 VM 的 Azure VM 扩展 blade 中,我可以看到 'test' 已创建,但它处于 'Unavailable' 状态。我是否缺少参数或前一步?
如果重要的话,Linux VM 是最新的 RHEL。
好像和虚拟机的OS有关。如果我使用 Windows Server 2016 VM,我 运行 下面的命令。
$vmName = 'vmName '
$resourceGroupName = 'resourceGroupName '
$vm = Get-AzureRmVm -Name $vmName -ResourceGroupName $resourceGroupName
$credential = Get-Credential
Set-AzureRmVMAccessExtension -ResourceGroupName $vm.ResourceGroupName -Credential $credential -VMName $vm.Name -Name 'test' -Location $vm.Location
它添加了一个 Extension,它的 STATUS
首先是 Unavailable
,然后我在门户中重新启动 VM,它工作正常。另外,如果我们使用 $vm | Restart-AzureRmVM
,我想我们会得到相同的结果。
如果我使用 最新的 RHEL Linux VM,该命令将无休止地 运行,但我可以看到扩展已创建,状态为不可用 在门户中。但是重启虚拟机后,扩展不见了。
根据此 article,Set-AzureRMVMAccessExtension
似乎适用于 windows
。
Azure VMs generally have a small piece of software installed on them called a VM agent. This small agent is installed on the underlying Windows OS and communicates with Azure to allow the user control over the OS without necessarily touching the OS itself.
如果可以,我推荐你使用Azure CLI访问,你可以参考这个article.