I just discovered this neat little feature of VCSIM (vCenter Server Simulator) which allows you to append a global string prefix to all vSphere objects in your inventory. I am not sure if this capability has always been there but definitely can be useful if you plan on running multiple VCSIM environments, this can be an easy way to uniquely identify a particular configuration.
To add the custom prefix, you will need to add the <prefix></prefix> tags to your VCSIM inventory configuration file. You can take a look at the default template /etc/vmware-vpx/vcsim/model/initInventory.cfg to get an idea of the available configurations.
Here is a the sample VCSIM configuration file for the inventory in the screenshot above:
<config> <inventory> <dc>1</dc> <host-per-dc>0</host-per-dc> <vm-per-host>0</vm-per-host> <poweron-vm-per-host>0</poweron-vm-per-host> <cluster-per-dc>1</cluster-per-dc> <host-per-cluster>2</host-per-cluster> <rp-per-cluster>1</rp-per-cluster> <vm-per-rp>3</vm-per-rp> <poweron-vm-per-rp>3</poweron-vm-per-rp> <dv-portgroups>0</dv-portgroups> </inventory> <prefix>vGhetto-</prefix> <worker-threads>1</worker-threads> <synchronous>true</synchronous> </config>
Michael Rice says
Is it possible to also configure what it names things? In my env I would like to name a Datacenter 12345 which for me is a customer number, then name HostSystems like 11111-hyp1.home.lab 11112-hyp2.home.lab then name my VirtualMachines like 11113-web1.mycustomer.com etc.. Those numbers for me would represent a device number. I dont mind having to provide a fully laid out xml file that describes exactly what I want to name each thing that is created if it is possible. Right now I am looking at having to make a script that will go rename everything after the fact, so if there is a way to make it happen when its being configured initially that would be more ideal.
William Lam says
This level of customization is currently not possible. You would need to create a script to either rename OR start with an empty inventory and build up using a script