With Flint's VMWare55 Connector you can launch and manage virtual machines in VCenter5.5 server.

With this document, we will be able to use and work with the VMWare55 Connector.

Design Aspects

Perform all standard application operations like Virtual Machine operations available through the VMWare VSphere SDK. Some of them are listed below:

  • Create virtual machine
  • Details of virtual machine
  • List virtual machine
  • Start virtual machine
  • Stop virtual machine
  • Reset virtual machine
  • Suspend virtual machine
  • Reboot virtual machine
  • Clone virtual machine 
  • The ability to set Connector execution timeouts
  • Synchronous / Asynchronous execution of the Connector

Connector Configuration


Configuration parameters

ParameterDescriptionRequired
nameVMWare55 connector nametrue: config/request
urlURL of VCenter5.5 server appliancetrue: config/request
usernameUsername of VCente5.5 server appliancetrue: config/request
passwordPassword of VCenter5.5 server appliancetrue: config/request
Example
{
   "name": "vmware55",
   "url": "vmware5.example.com",
   "username": "root",
   "password": "abc123" 
}

Actions


create-vm

 Create virtual machine on VCenter5.5 server with  given details.

Request param

ParameterDescriptionRequired
connector_nameName of the VMWare55 Connector to be configured.true
actionContains the name of the operation: create-vmtrue
urlURL of VCenter5.5 server appliancetrue
usernameUsername of VCenter5.5 server appliancetrue
passwordPassword of VCenter5.5 server appliancetrue
vm-nameName of virtual machine which you want to createtrue
datacenter-nameName of datacenter on which you want to a create virtual machinetrue
vm-memory-sizesize of RAM for virtual machinetrue
guest-os-idId for guest operating systemtrue
host-nameName of host on which you are going to createtrue
disk-sizesize of disk in KB which you want to create with virtual machinetrue
datastore-namename of datastore to allocate resources for virtual machinetrue
timeoutTimeout for VMWare55 connector executionfalse
Response parameters
ParameterDescription
exit-code and messagereturn exit code 0 and success if vm created successfully, otherwise return other than 0 and failed
Example
 
response = @call.connector("vmware")
                .set('action',"create-vm") 
		    	.set('url',"vmware5.example.com")
		   	    .set('username',"root")
		   		.set('password',"abc123")
				.set('vm-name',"test_vm")
		    	.set('datacenter-name', "abc")
		    	.set('vm-memory-size',2048)	
		    	.set('number-of-cpu',2)
		   	    .set('guest-os-id',"windows7guest")
		    	.set('host-name',"192.168.5.195")
	            .set('datastore-name',"datastore")
		    	.set('disk-size',1000000)
                .sync
#VMWare55 Connector Response Meta Parameters
response_exitcode = response.exitcode                   #Exit status code
response_message = response.message                     #Execution status messages

 

list-vm

 List virtual machine on VCenter5.5 server from given details.

Request param

ParameterDescriptionRequired
connector_nameName of the VMWare55 Connector to be configured.true
actionContains the name of the operation: list-vmtrue
urlURL of VCenter5.5 server appliancetrue
usernameUsername of VCenter5.5 server appliancetrue
passwordPassword of VCenter5.5 server appliancetrue
timeoutTimeout for VMWare55 connector executionfalse
Response parameters
ParameterDescription
Virtual MachinesSet of virtual machines available on VCenter 5.5 server
Example
 
response = @call.connector("vmware55")
                    .set('action','list-vm')
		    		.set('url','vmware5.example.com')
		    		.set('username','root')
		    		.set('password','abc123')
					.timeout(120000)
                    .sync
#VMWare55 Connector Response Meta Parameters
response_exitcode = response.exitcode                   #Exit status code
response_message = response.message                     #Execution status messages

#VmWare55 Connector Response Parameters
virtual_machine_list = response.get("Virtual Machine")  #VCenter5.5 server created virtual machine set

 

 

start-vm

Start virtual machine on VCenter5.5 server from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the VMWare55 Connector to be configured.true
actionContains the name of the operation: start-vmtrue
urlURL of VCenter5.5 server appliancetrue
usernameUsername of VCenter5.5 server appliancetrue
passwordPassword of VCenter5.5 server appliancetrue
vm-nameName of virtual machine to starttrue
timeoutTimeout for VMWare55 connector executionfalse
Response parameters
ParameterDescription
status-messagestatus message for virtual machine started or not
Example
 
response = @call.connector("vmware55")
                .set('action','start-vm')
		        .set('url','vmware5.infiverve.com')
		    	.set('username','root')
		    	.set('password','abc123')
 				.set('vm-name','vm1')
				.timeout(120000)
				.sync
 
# VMWare  Connector Response Meta Parameters
response_exitcode = response.exitcode # Exit status code
response_message =  response.message # Execution status message
 

stop-vm

Stop virtual machine on VCenter5.5 server from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the VMWare55 Connector to be configured.true
actionContains the name of the operation: stop-vmtrue
urlURL of VCenter5.5 server appliancetrue
usernameUsername of VCenter5.5 server appliancetrue
passwordPassword of VCenter5.5 server appliancetrue
vm-nameName of virtual machine to stoptrue
timeoutTimeout for VMWare55 connector executionfalse
Response parameters
ParameterDescription
status-messagestatus message for virtual machine stopped or not
Example
 
response = @call.connector("vmware55")
                .set('action','stop-vm')
		        .set('url','vmware5.infiverve.com')
		    	.set('username','root')
		    	.set('password','abc123')
 				.set('vm-name','vm1')
				.timeout(120000)
				.sync
# VMWare  Connector Response Meta Parameters
response_exitcode = response.exitcode # Exit status code
response_message =  response.message # Execution status message

reboot-vm

Reboot virtual machine on VCenter5.5 server from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the VMWare55 Connector to be configured.true
actionContains the name of the operation: reboot-vmtrue
urlURL of VCenter5.5 server appliancetrue
usernameUsername of VCenter5.5 server appliancetrue
passwordPassword of VCenter5.5 server appliancetrue
vm-nameName of virtual machine to reboottrue
timeoutTimeout for VMWare55 connector executionfalse
Response parameters
ParameterDescription
status-messagestatus message for virtual machine rebooted or not
Example
 
response = @call.connector("vmware55")
                .set('action','reboot-vm')
		        .set('url','vmware5.infiverve.com')
		    	.set('username','root')
		    	.set('password','abc123')
 				.set('vm-name','vm1')
				.timeout(120000)
				.sync
 
# VMWare  Connector Response Meta Parameters
response_exitcode = response.exitcode # Exit status code
response_message =  response.message # Execution status message

reset-vm

Reset virtual machine on VCenter5.5 server from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the VMWare55 Connector to be configured.true
actionContains the name of the operation: reset-vmtrue
urlURL of VCenter5.5 server appliancetrue
usernameUsername of VCenter5.5 server aappliancetrue
passwordPassword of VCenter5.5 server appliancetrue
vm-nameName of virtual machine to resettrue
timeoutTimeout for VMWare55 connector executionfalse
Response parameters
ParameterDescription
status-messagestatus message for virtual machine reseted or not
Example
 
response = @call.connector("vmware55")
                .set('action','reset-vm')
		        .set('url','vmware5.infiverve.com')
		    	.set('username','root')
		    	.set('password','abc123')
 				.set('vm-name','vm1')
				.timeout(120000)
				.sync
 
# VMWare  Connector Response Meta Parameters
response_exitcode = response.exitcode # Exit status code
response_message =  response.message # Execution status message

suspend-vm

Suspend virtual machine on VCenter5.5 server from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the VMWare55 Connector to be configured.true
actionContains the name of the operation: suspend-vmtrue
urlURL of VCenter5.5 server appliancetrue
usernameUsername of VCenter5.5 server appliancetrue
passwordPassword of VCenter5.5 server appliancetrue
vm-nameName of virtual machine to suspendtrue
timeoutTimeout for VMWare55 connector executionfalse
Response parameters
ParameterDescription
status-messagestatus message for virtual machine suspended or not
Example
 
response = @call.connector("vmware55")
                .set('action','suspend-vm')
		        .set('url','vmware5.infiverve.com')
		    	.set('username','root')
		    	.set('password','abc123')
 				.set('vm-name','vm1')
				.timeout(120000)
				.sync
 
# VMWare  Connector Response Meta Parameters
response_exitcode = response.exitcode # Exit status code
response_message =  response.message # Execution status message

vm-details

Retrieve details of  virtual machine on VCenter5.5 server from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the VMWare55 Connector to be configured.true
actionContains the name of the operation: vm-detailstrue
urlURL of VCenter5.5 server appliancetrue
usernameUsername of VCenter5.5 server appliancetrue
passwordPassword of VCenter5.5 server appliancetrue
vm-nameName of virtual machine to fetch detailstrue
timeoutTimeout for VMWare55 connector executionfalse
Response parameters
ParameterDescription
vm-detailsdetails of virtual machine
Example
 
response = @call.connector("vmware55")
                .set('action','vm-details')
		        .set('url','vmware5.infiverve.com')
		    	.set('username','root')
		    	.set('password','abc123')
 				.set('vm-name','vm1')
				.timeout(120000)
				.sync
 
# VMWare  Connector Response Meta Parameters
response_exitcode = response.exitcode    # Exit status code
response_message =  response.message     # Execution status message
 
#VmWare55 Connector Response Parameters
virtual_machine_details = response   #VCenter5.5 server created virtual machine details
 
 
 

clone-vm

Clonning  virtual machine on VCenter5.5 server from given details.

Request parameters
ParameterDescriptionRequired
connector_nameName of the VMWare55 Connector to be configured.true
actionContains the name of the operation: clone-vmtrue
urlURL of VCenter5.5 server appliancetrue
usernameUsername of VCenter5.5 server appliancetrue
passwordPassword of VCenter5.5 server appliancetrue
vm-namevirtual machine which you want to createtrue
datacenter-nameDatacenter name where virtual machine locatedtrue
host-nameHost name where virtual machine locatedtrue
clone-from-nameName of virtual machine from which you are going to create new virtual machinetrue
timeoutTimeout for VMWare55 connector executionfalse
Response parameters
ParameterDescription
status-messagestatus message for virtual machine cloned or not
Example
 
response = @call.connector("vmware55")
                .set('action','clone-vm')
		        .set('url','vmware5.infiverve.com')
		    	.set('username','root')
		    	.set('password','abc123')
				.set('datacenter-name','flint')
				.set('vm-name',"new_vm")
		        .set('clone-from-name','vm1')
		        .set('host-name','12.168.79.128')
				.timeout(120000)
                .sync
# VMWare  Connector Response Meta Parameters
response_exitcode = response.exitcode    # Exit status code
response_message =  response.message     # Execution status message
 

On this page: