【发布时间】:2020-01-12 02:00:51
【问题描述】:
我需要在 powercli / powershell 脚本中列出基于 Linux 的 vCenter (VCSA) 服务。 我不知道有任何 powercli cmdlet 会列出这些服务。 我想过使用 vSphere 6.5 中新引入的 vSphere REST API
我尝试使用 postman / vSphere API Explorer 的两个调用失败,无法授权:
https://{server}/rest/vcenter/services
https://{server}/rest/appliance/services
我能够使用 administrator@corp.local 列出虚拟机并创建新虚拟机,所以我不确定发生了什么
在 postman 和 REST explorer 中使用 vSphere REST API 测试列表服务
$url = "https://{server}/rest/vcenter/services"
Invoke-RestMethod -Method 'Get' -Uri $url -Credential $Cred
我的问题: 1) 是否有 powercli 命令列出基于 linux 的 vCenter (VCSA) 中的服务 2) 知道如何使用 vSphere REST API 完成此操作
【问题讨论】:
-
有可以下载的服务控制工具吗?
-
您好,该博客适用于具有 VAMI REST API 的 vSphere 6.5,我使用的是最新的 vSphere 6.7。
标签: rest powershell powercli vcenter