stumpr's Posts

I think that is a snippet I slapped together, I recognized the name of the file. The first issue of not seeing any output was an error on my part. I had the wrong value in the regex. I updat... See more...
I think that is a snippet I slapped together, I recognized the name of the file. The first issue of not seeing any output was an error on my part. I had the wrong value in the regex. I updated that to the proper value, you should see the VMs now. I verified it in my environment as well. As for the error, looks like the VirtualDevice list of one or more Virtual Machines was undefined. I added a few lines to the snippet. The first fixes the password prompt subroutine, returning the terminal mode back from noecho so you can actually type again if you're in a terminal or cmd prompt. The second was to add a check to see if the VirtualDevice list is undefined and print out the Virtual Machine that is the particular problem. This might provide some insight on which Virtual Machine is returning an undefined value for the VirtualDevice list. Even a bare minimal VM with just CPU/Memory defined will not trigger that condition (at least in my current environment). Something else is going on. Sorry that it didn't work the first time, I didn't add a lot of error checking. I just put it together as an example of how to enumerate devices and determine their hardware class as a way to locate particular virtual devices before calling specific class functions on the object. Try this updated version, it might point a finger at the culprit or at the very least skip the troublesome Virtual Machine(s). If you can determine the VM's with the issue, I'd like to hear about it.
That's primarily how I use the Perl Toolkit. I don't leverage the wrapper utility functions around the SDK. use VMware::VIRuntime; Once you do this, Vim is imported into your namespace. F... See more...
That's primarily how I use the Perl Toolkit. I don't leverage the wrapper utility functions around the SDK. use VMware::VIRuntime; Once you do this, Vim is imported into your namespace. From there you can do the bulk of the work. I just process username and passwords appropriately for the login. I sometimes leverage save_session and load_session to avoid re-entering passwords on interactive scripts. I think Perl makes an excellent testing framework. CPAN alone makes testing across platforms and environments much easier than most languages. I attached a simple script which I believe fits your description of how you'd like to use it.
How about something like this? I apologize for the rough snippet. If someone knows of a smoother way to filter out the devices by a view filter, I'd love to hear it. I ended up using 'isa' t... See more...
How about something like this? I apologize for the rough snippet. If someone knows of a smoother way to filter out the devices by a view filter, I'd love to hear it. I ended up using 'isa' to determine the superclass of the vmware device to determine which devices were VirtualEthernetDevices. This should work for determining other device types as well.