I did not get your word. Did you mean if i have no DHCP server i have to pass IP address to the VM i cloned manually? or VM will have no ip address after clone?
When you clone a VM, you can either customize it or not.
- If you do not customize the VM -
- The VM will retain all settings, including IP, from the original. This would be an exact clone of the original.
- If you do customize the VM -
- You can set DHCP in the cusotmization spec - The VM will get its IP address from a DHCP server on the network. This function is not provided by vSphere. If you have NSX, NSX Edge appliances can provide DHCP, but this is not part of the core vSphere product.
- Or - you can specify the IP address manually - this sets the VM adapter settings in static IP configuration, and you need to provide what those settings are (DNS, NTP, suffix, address, mask, gateway, etc.) in the customization spec.
Assume that i have a vlan 192.168.23.0/24 which have been set on distributed virtual port group. I want every cloned VM configured to an unique unused ip automatically in the VLAN 192.168.23.0/24. what should i do? I have to deploy a DHCP server and config the DHCP server with the vlan info?
You should establish a DHCP server with appropriate scope to hand out IP addresses in that VLAN. You will have to build this server manually if it does not already exist.
If the DHCP server is not in the same VLAN as the machines you're cloning, then you will need to ensure that your networking equipment is configured to forward DHCP packets to the VLAN where the DHCP server is located.
If it is on the same VLAN, then the packets will make it to the DHCP server because they occupy the same broadcast domain.
when i create or clone a virtual machine and specify the NIC to port group(vlan on it ) BUT no DHCP there will no ip set on the VM?
If you specify DHCP in the customization spec and there is no DHCP server available to answer the request - the adapter will either auto-configure itself with an APIPA address (i.e. 169.254.x.x) or it will get no settings.
If you specify manual/static IP configuration, then the server will get whatever configuration you specify in the customization specification.
You can test all of this manually in the vSphere client by right-clicking a VM or template, and clicking Clone --> Clone to Virtual Machine...:

After setting the name, target folder, target host, and target datastore, you can choose to customize it or not:

In order to do this, you must have already created a customization specificartion from within Home --> Policies and Profiles --> Customization Specification Manager
You can see the list of my available specs, and I have one set for DHCP as well as ones set that take static IP:

Depending on how you configured the customization specification, you will be prompted for some values to enter for the customization. In this case, it is prompting for static IP settings. If the customization specification was set for DHCP, it would not ask for the networking properties.
![]()
Note that guest customization requires interfacing with VMware Tools on the VM, so you should make sure you have installed VMware tools on Windows machines or the appropriate open-vm-tools package on Linux machines to ensure proper functionality. Linux machines also rely on Perl being present/installed, so make sure these are on your template VM when you build it.
![]()