Last year I wrote about a very interesting tool called vCenter Server Simulator (VCSIM) which allows a user to quickly simulate a VMware environment that can be comprised of thousands of ESXi hosts and virtual machines. VCSIM can benefit a variety of use cases such as learning about the vSphere API, creating reports for vSphere or vCloud Director to building vSphere Web Client plugins to help visualize large inventories. There was an overwhelming interest in VCSIM from last year and I received some great feedback and feature requests which I fed back to the VMware engineers who developed this internal tool.
With the upcoming version of vSphere 5.5 to be released very soon, I was wondering if there were going to be any new features for VCSIM in VCSA 5.5? I reached out to one of the engineers, Haiping Yang, who works in the Performance Engineering team who is currently taking over some of the development of VCSIM. Some of you might be familiar with some of her work such as the recent visualEsxtop, esxtop and resxtop to just name a few. In talking to Haiping, I found that she has been quite busy adding cool new features to VCSIM and this is on top of her regular day job!
Disclaimer: This is not officially supported by VMware, please use at your own risk.
Here is a quick summary of the new features of VCSIM 2.0:
Distributed Virtual Switch (VDS) Support:
- Add / Remove ESXi hosts from VDS
- Create / Delete Distributed Virtual Portgroup
- Reconfigure Distributed Virtual Portgroup
- Add / Remove VM from Distributed Portgroup
vCloud Networking & Security (vCNS) Support:
- Create / Delete vCNS Gateway
- Create / Delete Isolated/Routed Org Networks
- Create / Delete vApp Networks
- Deploy / Undeploy vApp with DHCP service enabled
Persistent Inventory Configuration upon restart:
- Folder, Cluster, Resource Pool, Host, Datastore, Virtual Machine, Network and VDS
Custom Configuration Support:
- ESXi version template
- ESXi configuration template
- Datastore configuration
- Virtual Machine datastore
Easy startup commands:
- vmware-vcsim-start
- vmware-vcsim-stop [true|false] - Determines whether the inventory is cleared after stopping VCSIM
Note: Before you can use VCSIM, you will need to configure the VCSA as you normally would by going through the VAMI interface or running through the SSH commands noted in this article.
I will not go over every single feature mentioned above, but I did want to take a look at a few noteworthy features such as the new VCSIM start/stop command, datastore configuration and ESXi host configuration templates.
VCSIM Start/Stop Commands:
With the previous version of VCSIM, you had to manually edit the vCenter Server configuration file (vpxd.conf) and append the necessary VCSIM configurations. In this release, we now have an easy to use command-line utility to start and stop VCSIM. The vmware-vcsim-start command supports several startup options.
To view the list of supported options, just run the following command:
vmware-vcsim-start help
Option 1 - You can specify a VCSIM configuration file and you can find several examples located in /etc/vmware-vpx/vcsim/model
Option 2 - You can specify either the keyword "empty" for a blank vSphere inventory or "default" which will automatically use /etc/vmware-vpx/vcsim/model/vcsim-default.cfg inventory configuration
Option 3 - You can just specify the inventory layout on the command-line. An example would be "custom:dc=1,cluster=1,rp=1,host=1,vm=1,vm_on=1,latency=true"
To get a list of all the available VCSIM configurations, take a look at /etc/vmware-vpx/vcsim/model/vcsim.cfg.template
Here is an example of starting VCSIM using the "default" mode:
vmware-vcsim-start default
Datastore Configuration:
Custom datastore configuration was something that was much sought after with VCSIM 1.0 and unfortunately, there was only a single global datastore that was automatically "connected" to all simulated ESXi host. The new version of VCSIM now supports custom datastore configurations that can be defined globally, at the cluster level, local storage as well as string prefix which can help you separate out different VCSIM instances.
Here is an example of the configuration that would need to be added to the VCSIM configuration file:
<datastore> <global>1</global> <cluster>4</cluster> <local>5</local> <prefix>vghetto</prefix> </datastore>
Here is what one of the simulated ESXi hosts would show for its datastores:
ESXi Configuration Template:
Another useful feature that I personally have asked for is the ability to customize an individual simulated ESXi host. Though this is still currently a work in progress, what you can do with VCSIM 2.0 is to customize the ESXi host version as well as the datastores on a per host basis. If you take a look vcsim.cfg.template, you will find a configuration line that looks like:
vcsim/model/hostConfig
This specifies a directory that would contain custom simulated ESXi host templates and their configurations. A sample host template is provided at /etc/vmware-vpx/vcsim/model/hostConfig.xml.template and currently, you need to specify the default simulated hostname (e.g. DC0_C0_H0.xml).
Here is an example of what that host template can look like:
<hostConfig> <datastores> <ds id="virtuallyGhetto-datastore-1"/> <ds id="virtuallyGhetto-datastore-2"/> <ds id="virtuallyGhetto-datastore-3"/> </datastores> </hostConfig>
Now if we go back to our DC0_C0_H0 ESXi host, you will see that the host template will override the global configuration:
For the two examples above, here is what I used in my custom VCSIM configuration file that I called vcsim-virtuallyghetto.cfg if you are interested in what I used:
<simulator> <enabled>true</enabled> <initInventory>vcsim/model/initInventory-default.cfg</initInventory> <hostConfigLocation>vcsim/model/hostConfig</hostConfigLocation> <datastore> <global>1</global> <cluster>4</cluster> <local>5</local> <prefix>vghetto</prefix> </datastore> </simulator>
I have already asked for the ability to fully customize the simulated ESXi host display name and have already been told that this is something they would consider for a future release. VCSIM 2.0 has also been improved to better operate with vCloud Networking & Security and vCloud Director. I was able to quickly test VCSIM 2.0 with the latest version of vCloud Director 5.5 and everything seems to be working fine. You can follow the existing instructions here for vCloud Director setup with VCSIM.
As you can see VCSIM 2.0 contains many new features and I highly encourage you to give it a spin when vSphere 5.5 is made generally available. There are definitely some additional fit and finish features that Haiping just could not get into this release. Hopefully we will get those updates in a future release of VCSIM and include additional ESXi template versions. If you have any feedback, comments or feature requests feel free to leave a comment and I will make sure it reaches Haiping and the development team. I do not want to spoil the surprise, but I just want to say one of the features coming in VCSIM 3.0 will be quite AWESOME! 😀 (sorry for the tease)
Anonymous says
Hi,
Great work by Haiping! This is very useful for Laptop based demonstration and learning where you don't have the resources to run multiple nexted VMs. Great work and looking forward to giving it a spin!
Maybe people can publish their cfg files with their creations?!
Mike
Anonymous says
how to download ?
hgrules says
This is indeed awesome.
What I was looking at is customizing the host hardware configuration (inventory) information.
Is there a possibility in 2.0 to achieve this?
James Green says
Super useful. I see myself using this a lot to write PowerCLI and test it "to scale" before taking it to production.
Something I'd really like to see (and maybe it's here and I just can't figure it out) is the ability to set custom names for the objects. For instance, I'd love to create labesx1 .. labesx? instead of the default D0_C0_H0 .. H?
@jdgreen
James Green says
Been playing with this a lot and I LOVE it!
Two more things I'd like to see some day:
- The ability to read from an existing inventory, akin to how the UCS PE can load up your config from production
- Some more details on how the settings work. I'd like to change my latencies to make it feel more real, but it's a little over my head without some documentation on that.
James Green says
Edit: I said I wanted more details on the ' < opsdelay > ' settings but I think the comment system thought it was HTML 😉
katsu says
Hi,
Big thanks for so great introduction. VCSim is looking great and if it is develop it will be great testing tool!
I would like to use vcsim 2.0 and have few questions about it. Hope you will be able to help me on that.
First is the uuid of ESXi host. It looks like VMs have different uuids but unfortunately for an ESXi host uuids are the same. I foud out that it is set in template "HostHardwareInfo" but can it be configured for each ESXi host separately? It's kinda crucial in my case as I relay on uuids. If it is not possible I can thing of solution in which I copy template directory and set different uuids and then pass this version to the host configs but here I have a problem with setting version. You mentioned that ESXi host version cen be set but I do not know how. In template file there is only a datastores section. So could you please tell me is this workaround possible with version and how provide this versions to single hosts?
Second thing are missing MAC adresses for ESXi hosts. I can see some configuration of MACs for VM, but I am not able to find it, and there is no MAC address for any of ESXi hosts. I found in "HostHardwareInfo" section with specification of PCI devices that are network cards but there is no example how to provide serial number there. Is there such possibility? Am I doing something wrong that there are no MACs for my hosts? Do you know something about it?
I would be grateful for all help about this topic! Without this uuid and mac I'm not able to use this great tool.
engr_dj says
Katsu where did you get the vmware vcenter server simulator?
Farooq says
Hi,
I have just encountered this issue of non-unique UUID's for ESX and VM's. All the ESX's have the same UUID. The VM's UUID's are unique within the same ESX but are duplicate accross other ESX's.
Is there a way to have unique UUID's for ESX and VM's. ??
nancy says
Katsu, I also meet the same problem as you, I need to simulate multi host uuid rather than unique one, have you found the solution?
engr_dj says
how do you download vCenter Server Simulator version 2.0/
Paul says
Thanks for these great write-ups! Is it possible to define performance metrics within host/dc/vm? Even if they are all the same, it would be very useful for my testing environment
William Lam says
Do a search for VCSIM and performance, there's entire article on how to get perf stuff setup.
Brian Clow says
This is great for simulating large environments... I was impressed how easy it was to simulate a 15k VM environment, and love how it responds to remote commands. Much kudus to the developers!
I'm looking at using this to address scalability issues when managing VMware environments. Static environment size is only part of the scalability issue when building out a VMware integration - churn in the environment is far more impactful if you're building an application that provide an up-to-date view of the environment. Are there any plans to augment VCSS to provide the ability to provide load in terms of churn?
I can build a simple tool right now that uses the SDK to generate state changes, migrations, creations, deletions; this is great! However, these are not the predominantly changing metrics I see in managed environments. Guest OS disk metrics, disk space changes, etc - these are the biggest churn contributors.
hari says
Brian,
How are you able to generate state changes.
Ranjani says
I am interested in knowing How to simulate VCNS environment. It is mentioned as a feature but i do not find the steps to simulate. Looking forward for some help with this.
Kiran says
Please share if you have documents to configure VCSIM on workstation. We would like to perform test but was not able to successful in installing and configuring VCSA on workstation 10.
William Lam says
Take a look at this article http://www.virtuallyghetto.com/2014/05/how-to-finally-inject-ovf-properties-into-vcsa-when-deploying-directly-onto-esxi.html which should help get your VCSA deployed onto Workstation
Dan Tehranian says
Awesome write up William! We found the vCenter Simulator to be very useful in our R&D team so I went ahead and made a way to turn the vCenter Simulator into a Vagrant box. Now our dev & QA folks can get the simulator up & running with just a single command.
See my post at: http://dantehranian.wordpress.com/2014/07/08/vagrant-vmware-vcenter-simulator/
William Lam says
Thanks for sharing Dan! That is a pretty nifty solution using Vagrant
varun says
Awesome article William. One question, do you know how to mix simulated ESXi hosts and real HOSTs? I need a deployment for testing that has mix of real ESXi hosts and large number of simulated hosts. Any though?
TIA
William Lam says
Yes, you simply just add your real hosts to the VCSIM instance 🙂 I recommend you separate your "simulated" and "real" setups such as using different Datacenter/Cluster object
varun says
Thanks a lot for prompt update. I will check it out today, but last time I tried, I could add the real host, but I was not able to create new real VM's on the real hosts.
But, will give it a try today again.
Thanks
Gavin says
Great article William, as usual. Thanks! Do you know if it's possible to simulate NFS shares as well as VMFS datastores?
William Lam says
I don't believe so
Aniruddha says
Thanks William for this wonderful work!.
I am working on one use case in which I am trying to integrate the VCSIM2.0 with OpenStack (JUNO). When I specified VCSIM in Nova configuration, OpenStack nova-compute is able to connect to VCSIM and it can see the simulated cluster (with one simulated host). Problem comes when we try to spin a VM using OpenStack APIs; Nova-compute service (responsible for boot a VM) in openstack tries to create a virtual disk on global datastore in VCSIM, but it fails saying that such operation is not supported. Even If we try to copy any file in the global datastore manually, that also fails... so I interprete that datastore is virtual and is not available for writing by external entity.
Now to avoid this problem, is it possible to have real data store connected to VCSIM, so that nova-compute service is able to create the virtual disk on real data store and copy the image in the process of spinning a VM?
William Lam says
VCSIM supports both "simulated" and "actual" hosts. In your case, if you need to perform operations on an actual Datastore, you will need an actual ESXi host that is connected to a Datastore and this would then work.
Aniruddha says
Thanks William, when I try to connect real host to VCSIM from VSphere client, then VCSIM seems to assume that it is a simulated host. after adding the host, if I disconnect and connect, then I get an error "authenticity of the host's ssl certificate is not verified". strange... 🙁 whereas when I connect the same ESXi host with real V-Center, there is no such error, and I am able to create new host on "actual" ESXi host from "actual" V-Center through Vshere client.
Any pointers for help will be appreciated...
Fernando says
Maybe this is not a newbe forum, and please correct me if I´m wrong, but three people asked for how to download the tool, and had zero answers.
I have the same question, and wonder if someone could tell me. Thanks !
William Lam says
Please take a look at http://www.virtuallyghetto.com/2012/12/vcenter-server-simulator.html for more details which I link on the very first sentence which I would hope most people would check out if they're completely new to VCSIM. To be explicitly clear, VCSIM is not something you download and you will know this if you read the article that introduces VCSIM (this article is meant to share new features in 2.0). VCSIM is bundled as part of the vCenter Server Appliance (VCSA), again how to use/etc. is available in the article I've linked.
Aniruddha says
I tried following steps to connect real host to VCSIM but it causes one problem: When a VM is created on real host from VSphere client (connected to VCSIM) on real host, VM is visible on VShere client connected to VCSIM but the same VM is not visible on real host when VShere client is connected to real host directly.
Steps to connect real host to VCSIM:
- VCSA 5.5 is running in "VCenter mode" (VCSIM is off) and real host is added. while adding all the existing VM on real host are visiblie on VSphere client connected to VCenter.
- VCSIM is turned on in vpxd.cfg and vpxd is restarted. NOw VCSIM is running, with a real host connected to it. If a real host is connected when VCSIM is turned on then VCSIM considers the new host as simulated host instead of real host.
Can you please help out in this use case? My ultimate goal is to connect real host with VCSIM and when I create a VM on real host from VShere cleint connected to VCSIM then VM should also be available/visible VShere Client connected to real host.
I understand that you have already acheived it so please help me out in finding where I am going wrong. Thanks for your time in advance...
Atul Pandey says
Hi William,
Even I was also trying to simulate a similar environment where I need to add an actual host with VCentere simulater.But unfortunately it didn't worked out for me. As a workaround first i added real host in VCSA then in vpxd.cfg i enabled simulator without clearing the database though it survived the vpxd restart and i was seeing the actul vm details in datastores.
Next time when i spawned a new VM in same cluster it shows me as active one and I expect it to get reflected in actual host as well but it didnot worked in that manner. So I would appreciate if you have any pointer which can help me to sought out this database sync up issue with VC simulator and real host.
William Lam says
To be honest, I've only added a real host to VCSIM, but not perform further operations. For my testing, it's either a fully simulated environment or real environment, as not all operations are implemented today, I didn't want to risk seeing some "odd" behavior. Even as I'm writing this up, even though I can add a real host, the global datastores seem to override though I am adding it after VCSIM has been setup. So it's possible this may not work 100% which again maybe expected, so I would recommend you separate out your environment. If you just need basic VM provisioning, then you can use VCSIM but if you need more operations than recommend you setup a Nested ESXi host to test those operations.
Justin Wu says
Hi William,
I have used your config file to create some objects, like data centers, hosts, VMs and etc. It's really quick and convenience. But in my test, I need to use the real host, for example, I need one Windows Server 2012 or SuSE Linux Server to attach LUN from the storage side. Seems like I cannot deploy any OVF/OVA file to the sim hosts, so can I use VCSIM to automatically create bunch of these real hosts? Thanks!
William Lam says
OVF/OVA deployments is not possible with VCSIM, as you need to store the bits 🙂 You'll need a real host to test that, remember VCSIM isn't meant to cover all use cases, it's just some basic ones.
If you have a few minutes, would love to get your feedback here http://www.virtuallyghetto.com/2015/01/feedback-needed-for-the-future-of-vcsim.html
Justin Wu says
So if I want to provision some real objects or connect the vcsim objects with the real hosts/storage, neither of them is possible, right?
Scott Lowrey says
Great blog, William. Thank you for all the information you've provided.
From extensive testing done so far with VCSIM, it does not appear that it can generate a "raw data feed"[1]. I.e., the simulation of performance data coming directly from a (simulated) ESXi host, rather than the vCenter database. Should this be possible with the simulator?
To verify, I constructed a QueryPerf in the Managed Object Browser to get cpu.ready (metric ID 12) for a virtual machine entity. I specified the start time to be within 30 minutes of the current time and set the interval ID to 300. This should cause vCenter to route the request directly to the ESXi host bypassing the vCenter database. The result was empty.
Changing the time span to something more than 30 minutes returns (simulated) results according to the StatsModel assigned to the metric.
We use the "raw" QueryPerf method to collect performance data in our product to minimize the load we put on large, busy vCenter deployments. If we can get VCSIM to provide this, we could really do some great scale testing.
Thanks again!
[1] https://pubs.vmware.com/vsphere-55/index.jsp#com.vmware.wssdk.pg.doc/PG_Performance.18.4.html?path=7_0_0_1_15_2_2#1106746
Mike says
Works great except for the Host and Datastore names. You mention DC0_C0_H0.xml as the default for the hosts but I cannot find it or is it that I need to create my own or?
Dave says
What is the secret to getting this thing to work?! I have gone over the blog entries numerous times but I can never actually get hosts to show. Tried my own cfg, default and 15k sample cfgs but none ever produce anything but single DC with 1 network. Everything else is blank. Tearing my hair out searching for an answer. I figure there is something small but necessary that I am missing and it probably seems obvious to everyone else but I just can't figure it out.
Dave says
Well, I have an update. For every option/configuration I have tried, it's either no inventory or the vpxd fails to initialize and times out. So far just crickets.
Raj says
Hi,
Do we have a version of VCSIM that works with vSphere 6.0 ?
Raj
DichKin says
Hello everybody,
I've got a little question for the configuration.
Is it possible to add a "network adaptater" on a ESX host in a lab environement.
I found only two nic cards. Is it possible to modify the hostHardwareInfo.xml template ?
Kind regards (ans sorry for my poor english)
Zaid Bepari says
Hello everyone,
Do the VCSIM support VMware NSX? I need to simulate VC for NSX interactions.
Thanks
Gaurav says
I was trying to add real hardware to VCSA 5.5 running simulator. It allow me the add the ESXi 5.5 host to it but after adding it does not show any virtual machines or Datastores that exists on ESXi host. Any idea what could be wrong here?
I am running simulator with below config and adding physical ESXi after it had detected all the simulated hosts
vmware-vcsim-start custom:dc=1,cluster=1,rp=2,host=50,vm=1000,vm_on=1000,latency=true
ranjith says
I am not seeing these command in vcenter 8.0 .Is this tool supported in vcenter 8.0?