VMware {code} Community
pranesh_rao82
Contributor
Contributor
Jump to solution

How to add ESX hosts into DVS using vsphere SDK for perl?

Hi,

I am a newbie to vsphere SDK for perl. Just started using it for automation a month back. I was looking for options to automate addition of ESXi hosts and their physical adapters to distributed virtual switch. I did get some details on how to do add using powerCLI. However, my requirements are in using vsphere SDK for perl. Any help would be appreciated.

Do we have similar subroutines or specs to be modified in vsphere SDK for perl inorder to add ESX hosts into DVS.?
Thanks & Regards,
Pranesh
0 Kudos
1 Solution

Accepted Solutions
stumpr
Virtuoso
Virtuoso
Jump to solution

You definitely can do it in Perl.  I don't have a working example, but maybe William will when he catches this thread Smiley Wink

If I get some free time tomorrow, I'll try to put something together to get you started, but you can also just map out the logic from LucD's script.

Basically Get-View is equivalent to Vim::get_view() and the New-Object calls would need to be mapped to the object type in Perl  For example, instead of New-Object VMware.Vim.DVSConfigSpec, it would be $spec = DVSConfigSpec->new( );

Reuben Stump | http://www.virtuin.com | @ReubenStump

View solution in original post

0 Kudos
2 Replies
stumpr
Virtuoso
Virtuoso
Jump to solution

You definitely can do it in Perl.  I don't have a working example, but maybe William will when he catches this thread Smiley Wink

If I get some free time tomorrow, I'll try to put something together to get you started, but you can also just map out the logic from LucD's script.

Basically Get-View is equivalent to Vim::get_view() and the New-Object calls would need to be mapped to the object type in Perl  For example, instead of New-Object VMware.Vim.DVSConfigSpec, it would be $spec = DVSConfigSpec->new( );

Reuben Stump | http://www.virtuin.com | @ReubenStump
0 Kudos
pranesh_rao82
Contributor
Contributor
Jump to solution

Hi,

Thanks for the response. I tried to map the logic from lucD's script to vsphere SDK for perl. It's working perfectly. Thanks for the suggestion.

Regards,

Pranesh

0 Kudos