VMware Communities
andrewbbrown
Contributor
Contributor

VMware Workstation 15 REST API unexpected result when creating virtual network with vmnets POST

While performing the VMware Workstation 15 REST API call to create a new network with a specific subnet, I'm getting an unexpected subnet created every time.

Example: While using the vmnets POST command, I'm requesting a new network named "vmnet11" as type "hostOnly" with dhcp set to "true" with a subnet "192.168.111.0" and mask of "255.255.255.0" but my response shows that a network with the subnet of "192.168.211.0" has been created.  (Note - while the request subnet is not in use, I do not get the requested subnet created correctly no matter what I change it to)

----(see attached!!)----

Am I doing something wrong - or is this a bug?

(Note - I deleted the newly-created network through the UI and re-ran the POST command mentioned above... I get a different subnet each time it creates the new network, but not the one that I request.)

Additional details:

*I had the same result when I tested this in the Tech Preview 2018 with vmrest API 1.1.0 (build 8888902) on Aug 17, 2018 on a Windows 10 Pro machine.

*The machine I'm testing on is a Dell Precision 7520 with the latest drivers and BIOS updates.

*It has a fresh Windows 10 Pro for Workstations 1803 with a newly installed VMware Workstation 15.0.0 build-10134415 with all available updates installed

*there are no additional security policies / configurations applied to this machine.  (It is an unmanaged machine where I installed the OS and I am the only administrator)

*After installing VMware Workstation 15, I opened it up via the UI to verify it was installed... accepted the trail license... and then closed VMware Workstation.  I opened up PowerShell as an administrator and ran the vmrest configure command to configure with a specific username/password... then re-ran the vmrest executable to start the service... I accessed the API via port 8697 and performed the API calls through the built-in UI - very similar to how it is shown here: https://www.vgemba.net/vmware/VMware-Workstation-2018-Tech-Preview/

Let me know if I need to provide additional details or how I can help or be of service. 

**Edit - subnet typo + clarification added within 1 min of posting.

Reply
0 Kudos
5 Replies
Sir_Percy
Contributor
Contributor

Hi andrewbbrown

Curious to know, are you seeing a similar result, when using the UI, using virtual network editor....instead of a REST API,

For clarity, could you provide more examples.. I would like to explore this option soon.

Thanks.

Reply
0 Kudos
Susie201110141
VMware Employee
VMware Employee

Model
CreateVmnetParameter {

name (string😞 The host network name,

type (string, optional😞 The host network type
= ['nat', 'hostOnly']stringEnum:"nat", "hostOnly"}

Example Value

{ "name": "string", 
   "type": "nat" }

So far, only two parameters"name, type" are supported.

Reply
0 Kudos
wujeff
Contributor
Contributor

Hi Andrew,

Thanks for trying out REST API, currently, customized DHCP settings are not supported yet.

Would you mind sharing how will you leverage REST API in your project? That will be helpful for us to understand how to provide more APIs for you.

Reply
0 Kudos
andrewbbrown
Contributor
Contributor

Hi - sorry for the very long delay in this response.  I did not have any issues when using the UI to perform this same task.  I will get the latest version next week, give & try a few more examples and share the examples/results with you in this thread. 

Thanks for your interest! 

Reply
0 Kudos
andrewbbrown
Contributor
Contributor

Hi - sorry for the extremely long delay in responding. 

What I am attempting to do is automate the setup of a nested ESXi / vSphere lab inside of VMware Workstation.

I am part of a team of developers who are working to automate the creation of Datacenters using only manufacturer binaries (vSphere / ESXi installation files), physical hardware and code.  In order to save a significant amount of $$ during the development process, we've been using nested virtualization inside of ESXi.  Our current process involves using automation pipelines (eg. Jenkins) that call APIs provided by vSphere & ESXi (via PowerCLI / Python / govmomi / etc) in order to set up host machine settings & networking, followed by virtual machine networking, deploying and configuring virtual ESXi hosts, vSphere and creating a nested vSphere instance (similar to how William Lam shows how to here), followed by Windows & Linux VM creation. 

Now that laptops are much more powerful (example - the new Precision 7730 machines have 6-core CPUs, 4xNVMe SSD slots and up to 128GB of ram) we are looking at options that would allow developers to perform dev work on their own mobile workstation with Windows / Linux without the need of bringing a second machine (Like William Lam does here) to dedicate as an ESXi machine.  Currently, developers are forced to set up the base layer ( laptop networking in VMware Workstation, first set of nested ESXi hosts, etc ) manually because VMware Workstation doesn't provide an automated way of accomplishing the same thing possible with ESXi / vSphere. 

I hope VMware gets to the point of having similar APIs for VMware Workstation as there are for ESXi soon!  I come from a Windows background and was used to Hyper-V & Virtualbox... while they both have free vagrant providers that can spin up virtual machines from APIs, I'm quite familiar with Hyper-V and its ability to do virtually anything via PowerShell that can be performed in the UI in native Windows 10 Pro - no server OS needed.  VMware Workstation is really lacking in the area of automation and if we could just run VMware nested virtualization in Hyper-V, we would avoid VMware Workstation all together, given its awesome automation capability. 

If there is anything else you would like to know, feel free to reach out and I'll try to get back much faster this time!  Hope this feedback helps - I would love to help make VMware Workstation a better product any way I can.

Thanks for your time.

Reply
0 Kudos