VMWare ISO via API

286 views
Skip to first unread message

Matteo

unread,
Feb 16, 2016, 8:52:47 AM2/16/16
to Packer


Hi

Packer currently uses SSH to communicate to the ESXi machine rather than the vSphere API.
This page (par. "Building on a Remote vSphere Hypervisor") states that at some point, the vSphere API may be used.

As we would like very much to implement our templating via Packer and our IT dept. can't provide us SSH access at hypervisor level (security reasons), we were wondering if there are active plans for implementing this?



Thank you




Matteo

unread,
Feb 22, 2016, 10:42:23 AM2/22/16
to Packer


ping :-)

日下部雄也

unread,
Feb 22, 2016, 11:27:12 AM2/22/16
to Packer

Hi,

Currently, vmware-esx driver get the IP address of the VM which isn't running VMware tools via esxcli with GuestIPHack. The code is here: https://github.com/mitchellh/packer/blob/master/builder/vmware/iso/driver_esx5.go#L235.
If we can retrieve the IP via API, vmware-esx driver can be written using vSphere API. But I don't know how to get the IP via API.


2016年2月23日(火) 0:42 Matteo <miste...@gmail.com>:
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/9089c81c-15ee-4525-a323-6783662b1a8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matt

unread,
Feb 22, 2016, 12:23:02 PM2/22/16
to Packer


Thank you for your answer Yuya!

I am not an expert, however to retrieve the IP from the esxcli should be possible possible.
Afaik VMware Tools needs to run in the OS running on that virtual machine.
The data object description of VMWare should provide some more information about it.

日下部雄也

unread,
Feb 22, 2016, 6:37:51 PM2/22/16
to Packer
I know we can get IP via API, if VMware tools is running on a VM. But we needs to get IP from the VM that VMware tools isn't running.
After installing OS, packer connects to the VM via ssh or winrm for the first time for provisioning. At that time VMware tools is not installed. So packer uses GuestIPHack. For details about GuestIPHack, please read this VMware's article: http://blogs.vmware.com/vsphere/2013/01/network-troubleshooting-using-esxcli-5-1.html

2016年2月23日(火) 2:23 Matt <miste...@gmail.com>:
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.

eike.ver...@native-instruments.de

unread,
Jan 24, 2017, 2:16:34 PM1/24/17
to Packer
Hi Yuya,

I was considering using packer through vsphere as well and would be interested in contributing to the development as well (if I manage to allocate the time for that ;) ). Couldn't you pull the MAC address of the VM from the HW config through the API and then send an ARP request to that MAC (assuming net setup allows to pass it on)? Don't know how much code would be involved, but would it be an option? Alternatively one could transfer the responsibility of installing VMware tools to the boot/PE phase of the VM (in the same sense as activating WinRM is).
I'd be happy to know if there is any work done on that topic.

Cheers,

Eike 
Message has been deleted
Message has been deleted
Message has been deleted

Rami AbuGhazaleh

unread,
Feb 16, 2017, 8:13:02 PM2/16/17
to Packer
There are several ways to get the IP address of a virtual machine without VMware tools installed.

It seems these are the "simplest" ways:
1. Configure the virtual machine's network adapter to use a static IP address.
2. Query the DNS server and look up the IP address of the virtual machine by its host name.

Rami AbuGhazaleh

unread,
Feb 16, 2017, 8:54:12 PM2/16/17
to Packer
See issue #4526 "investigate using vSphere API" here: https://github.com/mitchellh/packer/issues/4526
Reply all
Reply to author
Forward
0 new messages