VMware Cloud Community
maxel
Enthusiast
Enthusiast
Jump to solution

Retreive IP address from VC:VirtualMachine type object

How can i do that for VC:VirtualMachine Type?

0 Kudos
1 Solution

Accepted Solutions
Burke-
VMware Employee
VMware Employee
Jump to solution

Assuming a variable named "vm" for your VC:VirtualMachine object:

System.log("VM IP Address: "+vm.summary.guest.ipAddress);

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you!

Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator
for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter

View solution in original post

0 Kudos
5 Replies
Burke-
VMware Employee
VMware Employee
Jump to solution

Assuming a variable named "vm" for your VC:VirtualMachine object:

System.log("VM IP Address: "+vm.summary.guest.ipAddress);

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you!

Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator
for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
0 Kudos
stevenbright1
Enthusiast
Enthusiast
Jump to solution

Burke,

Could you also just use the following?

System.log("VM IP Address: " + vm.guest.ipAddress);

Burke-
VMware Employee
VMware Employee
Jump to solution

I'm sure you could... I just used the summary object because that's what my simple reporting workflow that I copied the line of code from was using Smiley Wink In that workflow, I was gathering a whole bunch of info - not all of which was under the .guest property, but was under .summary.guest.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you!

Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator
for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
0 Kudos
stevenbright1
Enthusiast
Enthusiast
Jump to solution

Works for me. I was just curious if there was a specific reason that you chose one path over the other.

Happy Friday! Smiley Happy

0 Kudos
maxel
Enthusiast
Enthusiast
Jump to solution

Thx..that works! Smiley Happy

0 Kudos