Немного новостей про PowerCLI:
Во-первых, ПаверСиЭлАй и распределенные коммутаторы. В PowerCLI нет команд по работе с dvSwitch.
Однако, они появились, пока экспериментально – http://labs.vmware.com/flings/vdspowercli.
Вот тут - vSphere Distributed Switch PowerCLI cmdlets - хороший короткий пост что там есть и как пользоваться.
Забавно, что есть несколько сторонних решений той же проблемы – PowerCLI + Distributed switch.
И во-вторых.
То, что использовал я (когда возникла нужда массово создавать и настраивать распределенные коммутаторы скриптом) – решение от авторов много раз упомянутой и крайне полезной книги VMware vSphere PowerCLI Reference: Automating vSphere Administration.
И я как-то только сейчас обнаружил на их сайте выложенный модуль с их собственными командлетами для vSphere – PowerCLI Book: Download Scripts, Functions and Modules.
Загружаем архив, распаковываем в какой-то из путей из переменной $env:PSModulePath.
И в профиль добавим команду
Import-Module PowerCLIBookИ, в общем-то, все.
Теперь команда
Get-Command -Module PowerCLIBookотобразит список командлетов из набора PowerCLI Book.
PS C:\> Get-Command -Module PowerCLIBook
CommandType Name Definition
----------- ---- ----------
Function Add-DistributedSwitchVMHost ...
Function Backup-MsSqlDatabase ...
Function Backup-VcConfig ...
Function Check-Service ...
Function Connect-VMHost ...
Function Delete-HardDisk ...
Filter Escape-MetaCharacters ...
Function Evacuate-VMHost ...
Function Export-Folders ...
Function Export-PermissionsToCSV ...
Function Export-VMLocation ...
Function Export-Xls ...
Function Get-ADUserObject ...
Function Get-AggregationJobs ...
Function Get-ClusterSummary ...
Function Get-DistributedSwitch ...
Function Get-DistributedSwitchCandidate ...
Function Get-DistributedSwitchNetworkAdapter ...
Function Get-DistributedSwitchPortGroup ...
Function Get-DistributedSwitchPrivateVLAN ...
Filter Get-FolderPath ...
Function Get-FolderStructure process {...
Function Get-IPPool ...
Function Get-LicenseKey process {...
Function Get-MissingPortgroups ...
Function Get-Network ...
Function Get-OvfDetails ...
Function Get-SnapshotCreator ...
Function Get-SnapshotExtra param($snap)...
Function Get-SnapshotTree ...
Function Get-StatInstances ...
Function Get-StatReference begin {...
Function Get-StatTypeDetail ...
Function Get-vAppIPAssignment ...
Function Get-vAppProductInfo ...
Function Get-vAppStartOrder ...
Function Get-vCenterScheduledTask ...
Filter Get-VILocation ...
Function Get-VIPath ...
Function Get-VMDiskMapping ...
Function Get-VMGuestDiskUsage ...
Function Get-VMHostPciDevice ...
Function Get-VMHostPnic ...
Function Import-Folders ...
Function Import-Permissions ...
Function Import-VMLocation ...
Function Move-Datastore ...
Function New-DistributedSwitch ...
Function New-DistributedSwitchNetworkAdapter ...
Function New-DistributedSwitchPortGroup ...
Function New-DistributedSwitchPrivateVLAN ...
Filter New-FolderStructure ...
Function New-IpPool ...
Function New-RegKey param($RegLocation, $RegKey, $RegValue)...
Function New-VMHostNetworkAdapter ...
Function Register-VMX ...
Function Remove-DistributedSwitch ...
Function Remove-DistributedSwitchNetworkAdapter ...
Function Remove-DistributedSwitchPortGroup ...
Function Remove-DistributedSwitchPrivateVLAN ...
Function Remove-DistributedSwitchVMHost ...
Function Rename-LocalUser ...
Function Restore-MsSqlDatabase ...
Function Set-DistributedSwitch ...
Function Set-DistributedSwitchNetworkAdapter ...
Function Set-DistributedSwitchPortGroup ...
Function Set-DistributedSwitchVMHost ...
Function Set-DPM ...
Function Set-IPPool ...
Function Set-LicenseKey ...
Function Set-StatIntervalLevel ...
Function Set-ThinDisk ...
Function Set-vAppIPAssignment ...
Function Set-vAppProductInfo ...
Function Set-vAppStartOrder ...
Function Set-VMAdvancedConfiguration ...
Function Set-VMOffline ...
Function Update-TemplateHardware ...
Function Wait-VMGuest ...
Рекомендую.

по поводу аддона из VMware Labs - если хочется использовать, то нужно помнить что его можно использовать только в x32 версии PowerCLI, в версии x64 он недоступен :(
ОтветитьУдалитьты же не пользуешься распределенными коммутаторами?
ОтветитьУдалитьи какая разница какой битности powerCLI?
Миша, совершенно верно - без причины я не использую dvS, но при проведении аудита платформы виртуализации могут встретиться оба вида виртуальных коммутаторов.
ОтветитьУдалитькак раз вчера мне нужно было собрать конфигурацию с 27 хостов, на которых используется dvS, но у меня vdsPowerCLI не заработал.
потом проверил, запустив x32-версию PowerCLI - там снап-ин доступен.
по ссылке - http://labs.vmware.com/flings/vdspowercli - в комментах пишут, что работает только с x32.
по другой ссылке - http://www.virtu-al.net/2011/11/01/vsphere-distributed-switch-powercli-cmdlets/ - пишут что Win7 вообще не поддерживается - "Windows required XP or Windows Server 2003 or 2008 is required (Windows 7 and Vista are not supported currently)" - а у меня как раз Win7 x64 :)