Как удалить «виртуальную группу портов», созданную для сети vMotion, используя pyVmomi python? - PullRequest
0 голосов
/ 19 декабря 2018

Используя командный код PowerCLI, я мог удалить «виртуальную группу портов», созданную для сети VMotion на хосте ESXi6.0.

Add-PSSnapin VMware.VimAutomation.Core;

Connect-VIServer -Server xxx.xxx.xxx.xxy -User administrator@vsphere.local -Password SomePswd;

$PGName='VMotion';

Remove-VMHostNetworkAdapter -Nic (Get-VMHostNetworkAdapter -VMHost (Get-VMHost -Name "xxx.xxx.xxx.xxx") | where{$_.PortGroupName -eq $PGName}) -Confirm:$false;

$PGvar = 'VMotion';

$dfltvpg = Get-VirtualPortGroup -Name $PGvar;

Remove-VirtualPortGroup -VirtualPortGroup $dfltvpg -Confirm:$false"

Как сделать то же самое с помощью API pyVmomi на VMware vCenter Server 6.0 (или 6.5).Я не смог найти подходящий вызов API для этого в VOB MOB.Пожалуйста, помогите мне с примером.

...