ResourceInfo

ResourceInfo is a representation of a resource grid object. This class inherits the base fact operations from GridObjectInfo and adds the provisioning operations for provisionable resources such as VMs. See MatrixInfo for how to script creation of Resource objects.

Constructor

ResourceInfo Construct a ResourceInfo

Methods

Summary:

ResourceInfo(String name)

Construct a ResourceInfo

setResourceManagerContainer(ResourceManagerContainer resourceManagerContainer)

Assign resource manager API

shutdownAgent()

Shut down the agent on this resource if it is online. Operation has no effect if agent is already offline.

setProvisioningContainer(ProvisioningContainer pc)

The ProvisioningContainer is implemented by the NodeManager. This sets the redirection.

provision()

Provision this resource for general use. If this resource is a template, a new instance is created.

provision(ProvisionSpec provisionSpec)

Provision this resource using the supplied <code>ProvisionSpec</code> instance. If this resource is a template, a new instance is created.

getProvisionedInstances()

Return all provisioned instances of this resource.

shutdown()

Initiate a soft shut down of this provisioned resource.

move(String repository)

Move the disk images for this VM to new repository.

shutdown(boolean hard)

Shut down this provisioned resource. Optionally initiating a hard shut down.

suspend()

Suspend this provisioned resource.

suspend(boolean hard)

Suspend this provisioned resource. Optionally initiating a hard shut down.

pause()

Pause this provisioned resource.

resume()

Resume a previsously paused provisioned resource.

personalize()

Personalize (autoprep) a provisioned resource.

saveConfig()

Save VM config of a provisioned resource.

applyConfig()

Apply VM config to a provisioned resource.

restart()

Restart this provisioned resource.

restart(boolean hard)

Restart this provisioned resource. Optionally initiating a hard shut down.

createTemplate(String newName)

Create a new Template resource from this resource using the supplied name.

createTemplate(VmSpec vmSpec)

Create a new Template resource from this resource using the supplied <code>VmSpec</code> instance.

clone(String newName)

Create a copy of this Resource using the supplied name.

clone(VmSpec vmSpec)

Create a copy of this Resource using the supplied <code>VmSpec</code>.

migrate()

Migrate this provisioned resource to another host.

migrate(String newHostName)

Migrate this provisioned resource to the supplied host.

check()

Check and resync the state of this resource. If this is a provisioned resource, this will determine whether the resource is up or down or does not exist.

createInstance()

Create a new provisionable resource. The name of the new resource is generated.

createInstance(VmSpec vmSpec)

Create a new provisionable resource using the supplied <code>VmSpec</code>.

destroy()

Destroy this provisionable resource.

cancel()

Cancel the current action on this resource.

checkpoint()

Create a checkpoint for a provisioned resource.

checkpoint(String checkpointName)

Create a checkpoint for a provisioned resource supplying a checkpoint name.

restore()

Restore a provisioned resource to a checkpoint

restore(String checkpointName)

Restore a provisioned resource to a checkpoint

makeStandAlone()

Remove dependencies from provisionable instance to a parent template This allows the template to be removed from the system without affecting the instance.

installAgent()

Install a GMS Agent on this provisionable resource. The new GMS Agent will communicate with this GMS server.

installAgent(PyDictionary params)

Install a GMS Agent on this provisionable resource. The new GMS Agent will communicate with this GMS server or the server specified in the params dictionary. The key value pairs supplied in the dictionary are the equivalent to the install command line <pre>-D</pre> options.

createVmHost(String provisionAdapter)

Create a new Vm host grid object associated with this physical resource. <p> The supplied provisioning adapter job name is required for qualifying the name of the new Vm Host. This operation is not supported if this is not a physical resource object.

getVmHost(String provisionAdapter)

Retrieve an existing Vm host grid object associated with this physical resource. <p> The supplied provisioning adapter job name is required for qualifying which Vm Host to retrieve. This operation is not supported if this is not a physical resource object.

Examples

  • VmSpec is used here for creating a clone on a named host from a template resource:

    
    
    resource = getMatrix().getGridObject(TYPE_RESOURCE,"myTemplate")      spec = VmSpec() spec.setNewName("newvm") spec.setHost('vmhost-qa')      resource.clone(spec)
    
  • VmSpec is used here to retrieve an existing ResourceInfo and print the value of a fact:

    resource = getMatrix().getGridObject("resource","redhat_lab1") print resource.getFact("resource.os.name")
    
  • VmSpec is used here to retrieve an existing ResourceInfo and initiate a provision operation on the Resource:

    vm = getMatrix().getGridObject("resource","winxpvm") vm.provision()
    

See Also