6.0 Managing Machines

A machine is a location where resources or services can be used such as a cluster, cloud or a store. Default machine properties include the description and whether or not it is active. A machine can be created, queried, modified and deleted.

6.1 Creating Machines

To create a new machine, use the command gmkmachine:

gmkmachine [-A | -I] [--arch architecture] [--opsys operating_system] [-o organization_name] [-d description] [-X, --extension property_name=property_value [,property_name=property_value...]] [--debug] [-?, --help] [--man] [--quiet] [-v, --verbose] [-V, --version] {[-m] machine_name}

Note Additional detail for this command can be found in the man page by issuing gmkmachine --man at the command line.
Example 1. Creating a machine
$ gmkmachine --arch amd64 --opsys linux "Linux Cluster" colony
Successfully created 1 machine
Note It is possible to have machines be created automatically when first encountered in a usage function (charge, reserve or quote). It is also possible to have machines automatically be created when initially added as a member of another object. In order for machine auto-generation to occur, the AutoGen property for the Machine object must be set to 'True'. This is the default. For machine auto-generation to occur when initially encountered in a usage function, the Values property of the machine attribute of the UsageRecord object must be set to '@Machine'. Additionally, for machine auto-generation to occur when a machine is added as a member of another object (such as a hypothetical Site object) via an association table (i.e. SiteMachine), the Values property for the machine attribute of the Association (i.e. Name) must be set to '@Machine', indicating that that value should be constrained to be a valid instance of the Machine object. The auto-creation of machines can be completely disabled by setting the AutoGen property for the Machine object to 'False'.
Example 2. Enable auto-generation of machines when initially seen in a charge
$ goldsh Attribute Modify Object==UsageRecord Name==Machine Values=@Machine
Successfully modified 1 attribute
Example 3. Disable all auto-generation of machines
$ goldsh Object Modify Name==Machine AutoGen=False
Successfully modified 1 object
Note It is possible to set a global default machine to which usage would be ascribed in quotes, reservations or charges where no machine is specified. This can be accomplished by setting the DefaultValue property for the Machine object to the desired machine name. It is also possible to set a machine default for a specific object, which will result in usage being ascribed to the specified machine when the object is attributed to the usage. This is done by creating a default usage override modifier. For example, to specify that whitecloud be the default machine for usage associated with the amy user, you might first create an attribute called DefaultMachine for the User Object with the Values property of @?=Machine. Then you would populate the new DefaultMachine property for the amy user with the value of whitecloud. See Customizing Objects for more information on default and other usage override modifiers.
Example 4. Assign a global default machine
$ goldsh Object Modify Name==Machine DefaultValue=cloud
Successfully modified 1 object

(Undefined variable: MyVariables.!CopyrightInfo!)