Virtual machines

Use the command-line interface to administer virtual machines.

Restriction: Certain information, such as hardware and IP addresses, is not available for virtual machines that are deployed on another system in a multisystem deployment subdomain. To retrieve this information you should connect to the PureApplication® Software instance on which the virtual machine is running

VirtualMachines object

A VirtualMachines object represents the collection of virtual machines within an instance on PureApplication Software. Objects of this type are used to create, delete, iterate over, list and search for virtual machines within an instance on PureApplication Software.

Help is available on the command-line interface for the VirtualMachines object. To get help, pass the VirtualMachines object as an argument to the help() function, as shown in the following example:
>>> help(deployer.virtualmachines)

VirtualMachines attributes

The VirtualMachines object has the following attributes:

cpucount
The number of virtual processors defined for this virtual machine. This value is an integer.
created
The creation time of the virtual machine, as number of seconds since midnight, January 1, 1970 UTC. When the virtual machine is displayed, this value is shown as the date and time in the local timezone. This value is numeric and is automatically generated by the system.
currentmessage
The message associated with the status of the virtual machine. This field contains an eight character string value that is generated by the system.
currentmessage_text
Specifies the textual representation of the currentmessage attribute. This attribute is a string representation of the currentmessage attribute in the preferred language of the requester. This status message is automatically generated by the system.
currentstatus
The status of the virtual machine. This field contains an eight character string value that is generated by the system.
currentstatus_text
Specifies the textual representation of the currentstatus attribute. This attribute is a string representation of the currentstatus attribute in the preferred language of the requester. This status message is automatically generated by the system.
desiredstatus
The intended status of the virtual machine. This field contains an eight character string value that is generated by the system.
displayname
The display name associated with this virtual machine in the hypervisor. This field contains a string value with a maximum of 1024 characters.
environment
The environment property shows the environment variables defined on the virtual machine. The value of this property is a Jython dictionary (dict) object.
Note: This dict object is intended only for reading. Nothing prevents updates to the dict object, but updates are not sent back to the PureApplication Software. Therefore, updates have no effect on the virtual machine.
hardware
The hardware details for the virtual machine.
hypervisormachineid
Specifies the ID assigned to the virtual machine by the hypervisor. This field contains a string value with a maximum of 1024 characters.
id
The ID of the virtual machine. This value is numeric and is automatically generated by the system.
image
Information about the image object associated with this virtual machine.
ip
A reference to the IP address used by this virtual machine. For more information about the properties and methods supported by IP objects, see IP or enter the following command:
>>> help(deployer.ip)
ips
A reference to the IP addresses assigned to this virtual machine. For more information on the properties and methods supported by IP objects, see IP or enter the following command:
>>> help(deployer.ips) 
memory
The amount of memory allocated to this virtual machine, in megabytes. This value is an integer.
migrationtargets
A list of hypervisors to which the virtual machine can be migrated. A value of None indicates that the hypervisor hosting the virtual machine has not been quiesced. An empty list indicates no suitable hypervisors were found. The returned list is mutable, but changes to the list have no effect.
name
The display name associated with this virtual machine. This field contains a string value with a maximum of 1024 characters.
patternpart
The virtual image part of the virtual machine in the pattern.
runtimeid
The runtime ID generated by the hypervisor on which this virtual machine is running. This field contains a string value with a maximum of 1024 characters.
scripthistory
The script execution history for the virtual system instance.
Script statuses for virtual system patterns. Use these values if you are working with a virtual system pattern:
RM05007
Timeout.
RM05008
Failure.
RM05009
Warning.
RM05010
Success.
Script statuses for classic virtual system patterns. Use these values if you are working with a classic virtual system pattern:
RM01000
Waiting to execute.
RM01006
Started.
RM01011
Stopped.
RM01012 - COMPLETE
Completed successfully with a return code of 0.
RM01013 - FAILED
Completed with a return code other than 0 or 2, or did not get any result back from the virtual machine.
RM01014 - FAILED
Script could not be transferred to the virtual machine.
RM01015 - FAILED
Script did not complete before the timeout expired.
RM01059 - WARNING
Completed with a return code of 2.
scripts
The scripts that have been run on the virtual machine, both during and after deployment.
state
The current state of the virtual system instance.
storageid
The hypervisor storage ID of the storage on which this virtual machine resides. This field contains a string value with a maximum of 1024 characters.
updated
The time the virtual machine was last updated, as number of seconds since midnight, January 1, 1970 UTC. When the virtual machine is displayed, this value is shown as the date and time in the local timezone. This value is numeric and is automatically generated by the system.
virtualapplication
A VirtualApplication object that references the virtual application instance to which this virtual machine belongs. For more information about the properties and methods supported by VirtualApplication objects, see Virtual application instances or enter the following command:
>>> help(deployer.virtualapplication)
virtualimage
A reference to the VirtualImage object from which this virtual machine originated. For more information about the properties and methods supported by VirtualImage objects, see Virtual images or enter the following command:
 >>> help(deployer.virtualimage)
virtualsystem
A VirtualSystem object that references the classic virtual system instance to which this virtual machine belongs. For more information about the properties and methods supported by VirtualSystem objects, see Classic virtual system instances or enter the following command:
>>> help(deployer.virtualsystem)

VirtualMachine object

A VirtualMachine object represents a particular virtual machine defined on the PureApplication Software. Use the VirtualMachine object to query and manipulate the virtual machine definition on the PureApplication Software. Attributes of the virtual machine are represented as Jython attributes on the VirtualMachine object. Relationships between the virtual machine and other resources on the IBM® PureApplication Software are also represented as Jython attributes on the VirtualMachine object. Manipulate these Jython attributes using standard Jython mechanisms to change to the corresponding data on the IBM PureApplication Software.

Help is available on the command-line interface for the VirtualMachine object. To get help, pass the name of the object as an argument to the help() function, as shown in the following example:
>>> help(deployer.virtualmachine)

VirtualMachine attributes

The VirtualMachine object has the following attributes:

cloud
Information about the cloud group object associated with this virtual machine.
cpucount
The number of virtual processors defined for this virtual machine. This value is an integer.
created
The creation time of the virtual machine, as number of seconds since midnight, January 1, 1970 UTC. When the virtual machine is displayed, this value is shown as the date and time in the local timezone. This value is numeric and is automatically generated by the system.
currentmessage
The message associated with the status of the virtual machine. This field contains an eight character string value that is generated by the system.
currentmessage_text
Specifies the textual representation of the currentmessage attribute. This attribute is a string representation of the currentmessage attribute in the preferred language of the requester. This status message is automatically generated by the system.
currentstatus
The status of the virtual machine. This field contains an eight character string value that is generated by the system.
currentstatus_text
Specifies the textual representation of the currentstatus attribute. This attribute is a string representation of the currentstatus attribute in the preferred language of the requester. This status message is automatically generated by the system.
desiredstatus
The intended status of the virtual machine. This field contains an eight character string value that is generated by the system.
displayname
The display name associated with this virtual machine in the hypervisor. This field contains a string value with a maximum of 1024 characters.
environment
The environment property shows the environment variables defined on the virtual machine. The value of this property is a Jython dictionary (dict) object.
Note: This dict object is intended only for reading. Nothing prevents updates to the dict object, but updates are not sent back to the PureApplication Software. Therefore, updates have no effect on the virtual machine.
hardware
The hardware details for the virtual machine.
hypervisormachineid
Specifies the ID assigned to the virtual machine by the hypervisor. This field contains a string value with a maximum of 1024 characters.
id
The ID of the virtual machine. This value is numeric and is automatically generated by the system.
ip
A reference to the IP address used by this virtual machine. For more information about the properties and methods supported by IP objects, see IP or enter the following command:
>>> help(deployer.ip)
ips
A reference to the IP addresses assigned to this virtual machine. For more information on the properties and methods supported by IP objects, see IP or enter the following command:
>>> help(deployer.ips) 
memory
The amount of memory allocated to this virtual machine, in megabytes. This value is an integer.
migrationtargets
A list of hypervisors to which the virtual machine can be migrated. A value of None indicates that the hypervisor hosting the virtual machine has not been quiesced. An empty list indicates no suitable hypervisors were found. The returned list is mutable, but changes to the list have no effect.
name
The display name associated with this virtual machine. This field contains a string value with a maximum of 1024 characters.
patternpart
The virtual image part of the virtual machine in the pattern.
runtimeid
The runtime ID generated by the hypervisor on which this virtual machine is running. This field contains a string value with a maximum of 1024 characters.
scripts
The scripts that have been run on the virtual machine, both during and after deployment.
scripthistory
The script execution history for the virtual system instance.
storageid
The hypervisor storage ID of the storage on which this virtual machine resides. This field contains a string value with a maximum of 1024 characters.
updated
The time the virtual machine was last updated, as number of seconds since midnight, January 1, 1970 UTC. When the virtual machine is displayed, this value is shown as the date and time in the local timezone. This value is numeric and is automatically generated by the system.
virtualimage
A reference to the VirtualImage object from which this virtual machine originated. For more information about the properties and methods supported by VirtualImage objects, see Virtual images or enter the following command:
 >>> help(deployer.virtualimage)
virtualsystem
A VirtualSystem object that references the classic virtual system instance to which this virtual machine belongs. For more information about the properties and methods supported by VirtualSystem objects, see Classic virtual system instances or enter the following command:
>>> help(deployer.virtualsystem)

VirtualMachine methods

The VirtualMachine object has the following methods:
clone
Clones the resource represented by this object.
delete
Deletes the resource represented by this object.
download(filename)
Downloads the script execution history log file.
Example:
>>> vm = deployer.virtualsystems[0].virtualmachines[0]
>>> vm.scripthistory[0].get("scriptstatus")[0].get("logs")[0].download("home/test")
executeScript(Python dictionary object with a script (Script Object), Python dictionary object with parameters)
Runs the specified script on a virtual machine.
Example:
>>> vm = deployer.virtualsysteminstances.get("a-514a41").virtualmachines()[0]
>>> vm.executeScript({"script":vm.scripts[0]})
start()
Starts a virtual machine.
stop()
Stops a virtual machine. The virtual machine continues to reserve the resource used by that virtual machine.
waitFor
Waits for the virtual machine to arrive at a specific status such as running or failed.

For more information about working with resources on the command-line interface, see the Related concepts section.

You can control user and user group access to classic virtual system instances using the ACL object. For more information about the ACL object, see the Related reference section.