Classic virtual system instances
Use the command-line interface to administer classic virtual system instances.
VirtualSystems object
A VirtualSystems object represents the collection of classic virtual system instances defined to the IBM® PureApplication® Software. Objects of this type are used to create, delete, iterate over, list and search for classic virtual system instances on the IBM PureApplication Software.
>>> help(deployer.virtualsystems)
VirtualSystems methods
- create
- Creates a classic virtual system instance based
on a pattern. This method accepts a single parameter that describes
the classic virtual system instance to
be created. This parameter can be any of the following:
- A dictionary (dict) object with
the required and optional keys, as shown in the following example:
If a dict object is supplied, the following keys are recognized:>>> deployer.virtualsystems.create({'name': 'my virtual system', ... 'cloud': myCloud, 'pattern': thepattern, ... '*.*.password': 'mypassword'})
- endtime
- The time at which the classic virtual system instance is stopped, expressed as the number of seconds since midnight, January 1, 1970 UTC. See the description of the starttime method for additional details. This key is optional. If it is not specified, the classic virtual system instance runs until it is manually stopped.
- environmentprofile
- A reference to the EnvironmentProfile object that specifies the environment profile to be used for the classic virtual system instance. For more information about obtaining an EnvironmentProfile object, see the `deployer.environmentprofiles help or the Related reference section. Either this key or the cloud key is required. If this key is specified, the supplied dict object must also include additional information. The dict object must include the cloud groups, IP groups, IP address, and host names to be used for deployment.
- name
- The name for the classic virtual system instance as a string. This key is required.
- pattern
- A reference to the Pattern object for the new classic virtual system instance. For more information about obtaining a Pattern object, see the deployer.patterns help or the Related reference section. This key is required.
- starttime
- The time at which the classic virtual system instance is
started, expressed as the number of seconds since midnight, January
1, 1970 UTC. This value is most easily obtained using the Jython
time module, particularly the time.time() and time.mktime() functions,
as shown in the following example:
This key is optional. If it is not specified, the IBM PureApplication Software attempts to start the classic virtual system instance immediately.>>> # April 15th, 2009, 7am local time >>> time.mktime((2009,4,15,7,0,0,0,0,-1)) >>> # 1 hour (3600 seconds) from now >>> time.time() + 3600
The dict object can also supply additional keys that specify the values for part properties and script parameters required by the pattern. The set of required properties and parameters depend on the pattern. Some patterns might supply default values for all properties and parameters, in which case no additional values are needed. If the pattern you specified requires properties or parameters that you have not specified, this method raises an exception. The exception indicates which additional properties and parameters require values. You can also use the listConfig() method on the pattern object to determine which part properties and script parameters the pattern recognizes.
To specify a value for a part property, use a key in the following format:part-<part_id>.<property_pclass>.<property_key>
The following example shows this format:{ ..., 'part-1.ConfigPWD_ROOT.password': 'mypassword', ... }
Parameters for scripts are specified using a similar syntax, as the following example shows:
The following example shows this format:part-<part_id>.script-<script_id>.<parameter_key>
{ ..., 'part-1.script-1.NUM_WIDGETS': '10', ... }
For both part properties and script parameters, any of the three pieces of the key can be an asterisk (*) to match any value for that piece. See the following examples:- part-1.ConfigPWD_ROOT.password
- Specifies the value for the root password on the part with ID 1.
- *.ConfigUSER_ROOT.password
- Specifies the user password for all the parts.
- part-3.*.password
- Specifies a value to be used for all the passwords for part 3, including any script parameters that have a key of password.
- *.*.password
- Specifies a value to be used for all part properties and script parameters with a key of password.
- *.*.*
- Specifies a value to be used for all part properties and script parameters. This idiom is handled by the command-line interface, but it is rarely useful.
If more than one key in the dict object can be used for a given part property or script parameter, the most specific matching key is used. A key with a wildcard closer to the end is considered less specific. For example, when attempting to discover a value for part-1.ConfigPWD_ROOT.password, the dict keys are considered in the following order:- part-1.ConfigPWD_ROOT.password
- *.ConfigPWD_ROOT.password
- part-1.*.password
- *.*.password
- part-1.ConfigPWD_ROOT.*
- *.ConfigPWD_ROOT.*
- part-1.*.*
- *.*.*
If an environment profile is used for the deployment, the dict object must include specific information. The dict object must include information about the cloud groups and IP groups to be used for each part in the pattern. If the environment profile specifies that the IP addresses are to be specified by the person deploying the pattern, then the dict object must specify additional information. The dict object must also include IP addresses for each part and can also include host names for each part. This information is supplied in the dict object using a syntax like that described for part properties and script parameters. The following conventions are used for these keys:- part-<part_id>
- Indicates the part to which the information applies, as with part properties and script parameters.
- vm-<vm_number>
- For group parts, indicates a particular virtual machine to be built when the part is deployed. The vm_number must be in the range [1..part.count], inclusive. For example, if a group part has a count value of 5 then the virtual machines are designated vm-1 through vm-5. For parts that do not belong to a group, part.count is None, vm_number must always be 1. A single virtual machine is designated vm-1.
- nic-<nic_number>
- Indicates a particular network interface on the virtual machine. All parts have at least one network interface, designated nic-1. Additional network interfaces are designated in numeric order, for example nic-2 and nic-3, if additional NIC add-ons have been added to the part. The network interfaces are ordered the same as the corresponding add-on pattern scripts in part.scripts.
The following keys in the dict object are used as the source of environment profile deployment data:- part-<part_id>.cloud
- Specifies a Cloud object for
the cloud group to be used for the part. The cloud group must be
associated with the environment profile. Important: If a part represents a group of virtual machines, all virtual machines must be in the same cloud group.
- part-<part_id>.vm-<vm_number>.nic-<nic_number>.ipgroup
- Specifies the IPGroup object to be used for the network interface. The IP group must be associated with the cloud group in the environment profile.
- part-<part_id>.vm-<vm_number>.nic-<nic_number>.ipaddress
- If the environment profile indicates that the user deploying the pattern is to supply IP addresses, this key is used to supply the IP address, or addresses, to be used for the network interface.
- part-<part_id>.vm-<vm_number>.nic--<nic_number>.hostname
- This key behaves like the IP address key, but it is used to provide
host names. Unlike IP addresses, host names are never required.
The semantics and syntax for single and multiple values are identical
to IP addresses. As with part properties and script parameters, an
asterisk (*) can be used to specify a value that
applies to more than one part, as shown in the following example:
{ ..., \n 'environmentprofile': myenvpro, '*.cloud': mycloud, # all parts to one cloud '*.*.nic-1.ipgroup': ipgroup1, # all built-in intfs to ipgroup1 'part-1.vm-1.nic-1.ipaddress: '1.2.3.4', 'part-1.vm-2.nic-1.ipaddress: '1.2.3.5', 'part-3.vm-1.nic-1.ipaddress: '1.2.3.6', 'part-3.*.nic-2.ipgroup': ipgroup2, # extra nic goes to ipgroup2 'part-3.vm-1.nic-2.ipaddress': '5.6.7.8' 'part-3.vm-1.nic-2.hostname': 'foo.mycompany.com', ... }
- The name of a file containing a Jython expression that evaluates to one of the values in this list.
- The value deployer.wizard or a wizard instance created by calling deployer.wizard(). If either of these values is supplied, the command-line interface prompts interactively for the values to create the classic virtual system instance. For more information about using the wizard to create a VirtualSystem object, see the Related reference section.
- A list of any of the items previously listed, in which case multiple classic virtual system instances are
created, as shown in the following example:
>>> deployer.virtualsystems.create(['vs1', {'name':'foo',...}])
- A dictionary (dict) object with
the required and optional keys, as shown in the following example:
VirtualSystem object
A VirtualSystem object represents a particular classic virtual system instance defined on PureApplication Software. Use the VirtualSystem object to query and manipulate the classic virtual system instance definition on the IBM PureApplication Software. Attributes of the classic virtual system instance and relationships between the classic virtual system instance and other resources on the IBM PureApplication Software are represented as Jython attributes on the VirtualSystem object. Manipulate these Jython attributes using standard Jython mechanisms to change the corresponding data on the IBM PureApplication Software.
>>> help(deployer.virtualsystem)
VirtualSystem Attributes
- acl
- The access control list for this classic virtual system instance.
This field is read-only. For additional help on using this object,
enter the following command:
>>> help(deployer.acl)
- created
- The creation time of the classic virtual system instance, as number of seconds since midnight, January 1, 1970 UTC. When the classic virtual system instance is displayed, this value is shown as the date and time in the local time zone. This read-only value is numeric and is automatically generated by the system.
- currentmessage
- The message associated with the status of the classic virtual system instance. This read-only attribute has an eight character string value that is automatically generated by the system.
- currentmessage_text
- Specifies the textual representation of the currentmessage attribute. The currentmessage_text attribute is a string representation of the currentmessage attribute in the preferred language of the requester. The currentmessage attribute is automatically generated by the system.
- currentstatus
- The status of the classic virtual system instance. This read-only attribute has an eight character string value that is automatically generated by the system.
- currentstatus_text
- Specifies the textual representation of the currentstatus attribute. The currentstatus_text attribute s a string representation of the currentstatus attribute in the preferred language of the requester. The currentstatus_text attribute is automatically generated by the system.
- desiredstatus
- Indicates the status in which you want the classic virtual system instance to be. Setting this value causes PureApplication Software to initiate the steps to get the classic virtual system instance to this state.
- desiredstatus_text
- Specifies the textual representation of the desiredstatus attribute. The desiredstatus_text attribute is a string representation of the desiredstatus attribute in the preferred language of the requester. The desiredstatus_text attribute is automatically generated by the system.
- environmentprofile
- An environment profile object that references the profiles used
to create this classic virtual system instance.
For more information about the properties and methods supported by
environment profile objects, see the Related reference section
or use the following command:
>>> help(deployer.environmentprofile)
- id
- The ID of the classic virtual system instance. This value is numeric and is automatically generated by the system. This field is read-only.
- maintenances
- A resource collection containing the fixes applied to this classic virtual system instance.
For more information about the properties and methods supported by Maintenances objects, see the Related
reference section or use the following command:
>>> help(deployer.maintenances)
- name
- The name associated with this classic virtual system instance. Each classic virtual system instance must have a unique name. This field contains a string value with a maximum of 1024 characters. When a classic virtual system instance is created, its name cannot be changed. This field is read-only.
- owner
- A User object that references
the owner of this classic virtual system instance.
For more information about the properties and methods supported by User objects, see the Related
reference section or enter the following command:
>>> help(deployer.user)
- pattern
- A reference to the Pattern object
from which this classic virtual system instance was
created. For more information about the properties and methods supported
by Pattern objects, see the Related
reference section or enter the following command:
>>> help(deployer.pattern)
- snapshots
- A resource collection containing the snapshots taken of this classic virtual system instance.
For more information about the properties and methods supported by
the Snapshots objects, see the Related
reference section or enter the following command:
>>> help(deployer.snapshots)
- updated
- The time the classic virtual system instance was last updated, as number of seconds since midnight, January 1, 1970 UTC. When the classic virtual system instance is displayed, this value is shown as the date and time in the local time zone. This value is numeric and is automatically generated by the system. This field is read-only.
- virtualmachines
- A resource collection containing the virtual machines within this classic virtual system instance.
For more information about the properties and methods supported by
the VirtualMachines objects, see
the Related reference section or enter the
following command:
>>> help(deployer.virtualmachines)
VirtualSystem methods
- applyFixes(fixes, start=0)
- This method creates a maintenance request using the list of fixes
provided and an optional start time. The fixes are applied in the
order they are shown in the list. If no start time is provided, the
fixes are applied immediately.
>>> fixes = vs.findFixes() >>> vs.applyFixes(fixes) # start right now >>> vs.applyFixes(fixes, time() + 360000) # start in an hour
- applyUpgrade(image, start=0):
- Creates a maintenance request using the virtual image name provided
and an optional start time. If no start time is provided, the image
upgrade is applied immediately.
>>> images = vs.findUpgrades() >>> vs.applyUpgrade(images[0]) # start right now >>> vs.applyUpgrade(images[0], time() + 360000) # start in an hour
- createSnapshot()
- Creates a snapshot of this classic virtual system instance. This method takes an optional dictionary that can contain a description for the snapshot.
- delete()
- Deletes the classic virtual system instance.
This method accepts the following optional parameters:
- deleteRecord
- This boolean parameter controls whether records and logs associated with the classic virtual system instance are left on the system after the classic virtual system instance is deleted. The default value, True, deletes all information associated with the classic virtual system instance. A value of False leaves those records on the system for future inspection.
- ignoreErrors
- This boolean parameter controls whether the system continues attempting to delete a classic virtual system instance after an error is encountered. The default value, False, causes the attempted delete to fail if an error is encountered.
>>> myvirtsystem.delete(ignoreErrors=True, deleteRecord=False)
CAUTION:Using the ignoreErrors parameter is helpful in specific situations only, so use this option with caution. You might know that the virtual machines cannot be deleted and you choose to clean them up manually, for example. Or you might know that the server hosting the virtual machine is no longer available. Therefore, deletion would not occur if the errors blocked it. You can use the ignoreErrors parameter in these circumstances to force deletion of a classic virtual system instance, even if the virtual machines cannot be deleted. - findFixes()
- This method returns the list of fixes that can be applied to this classic virtual system instance. When a fix has been applied to a system, it is no longer displayed in this list.
- findUpgrades()
- This method returns the list of virtual image upgrades that can be applied to this classic virtual system instance. When a system has been upgraded, the image, and any of its predecessors, are no longer displayed in this list.
- start()
- Starts this classic virtual system instance.
- stop()
- Stops this classic virtual system instance.
- store()
- Stores this classic virtual system instance.
- updatePriority("high"|"medium"|"low")
- Update the priority of the classic virtual system instance.
>>> cvs = deployer.virtualsystems['d-bb0f1fe3-832c-430b-88bf-a54ef4cb6c83'][0] >>> cvs { ... "deploymentid": "d-bb0f1fe3-832c-430b-88bf-a54ef4cb6c83", ... "priority": 16, ... } >>> cvs.updatePriority("low") >>> cvs { ... "deploymentid": "d-bb0f1fe3-832c-430b-88bf-a54ef4cb6c83", ... "priority": 4, ... } >>>
Note: Classic virtual system instances report their priority as an integer.
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 see the Related reference section.