How to create a virtual machine through SDK API/method call
search cancel

How to create a virtual machine through SDK API/method call

book

Article ID: 309735

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article provides steps to create a virtual machine through SDK API/method call using vSphere Web Services SDK 5.0.

Environment

VMware vSphere Web Services SDK 5.0
VMware vSphere ESXi 5.0
VMware vSphere Web Services SDK 4.1

Resolution

You can use CreateVM_Task API/method to create a new virtual machine. You can download vSphere SDK 5.0 at VMware vSphere Web Services SDK Documentation.

To create a virtual machine through SDK API/method call:
  1. Log in to the server via the log in API with login credentials. For more information, see VMware vSphere API Reference Documentation Guide.
  2. Retrieve the Service object.
  3. Invoke the CreateVM_Task API on the Service object passing the required parameters. Fore more information on CreateVM_Task method, see VMware vSphere API Reference Documentation Guide.
  4. Refer to the runnable sample code VMCreate.java under the package com.vmware.samples.vm.

For more information, see: