com.novell.zos.jdl
Class ProvisionSpec

java.lang.Object
  extended by com.novell.zos.jdl.ProvisionSpec

public class ProvisionSpec
extends java.lang.Object

Defines the attributes for initiating a provision action.

An instance of this class is passed to the resource.provision() method.

Example of using ProvisionSpec for defining a provision to reserve a VM resource named 'sles10' for the user 'nightly'

      vm = getMatrix().getGridObject(TYPE_RESOURCE,"sles10")
      spec = ProvisionSpec()
      spec.setReserveForUser('nightly')
      vm.provision(spec)
 

If no reservations are specifed the lifecycle mode is MODE_MANUAL.


Constructor Summary
ProvisionSpec()
          Construct a default ProvisionSpec.
 
Method Summary
 void setAssignHostImmediately(boolean value)
          Set whether to wait or assign the host immediately.
 void setAutoprep(org.python.core.PyDictionary autoprep)
          Set facts for personalizing the new VM.
 void setFailToAlternativeHost(boolean value)
          Set whether when failing over a VM other hosts can be considered.
 void setFailToAlternativeNetwork(boolean value)
          Set whether when failing over a VM other networks can be considered.
 void setFailToAlternativeRepository(boolean value)
          Set whether when failing over a VM other repositories can be considered.
 void setHost(java.lang.String host)
          Set the host to provision the resource on.
 void setIdleTimeout(int idleTimeout)
          Set idle timeout for provisioned resource.
 void setNetworkMapping(org.python.core.PyDictionary mapping)
          Set the vnic to network mapping to use for provisioning.
 void setPriority(int priority)
          Set a priority for VM host allocation for this provision using supplied integer constant.
 void setPriority(java.lang.String priority)
          Set a priority for VM host allocation for this provision using supplied string.
 void setRepository(java.lang.String repository)
          Set the repository to provision the resource on.
 void setReserveForJob(java.lang.String jobID)
          Set the job ID to reserve the provisioned resource for.
 void setReserveForUser(java.lang.String userID)
          Set the user ID to reserve the provisioned resource for.
 void setReserveWithPolicy(java.lang.String policyText)
          Set a policy to use for reserving the provisioned resource.
 void setUseAutoprep(boolean value)
          Set whether to use the autoprep facts on the resource for creating the new VM.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProvisionSpec

public ProvisionSpec()
Construct a default ProvisionSpec.

Method Detail

setReserveForJob

public void setReserveForJob(java.lang.String jobID)
Set the job ID to reserve the provisioned resource for. Default is no job. If set the mode of the provision will be MODE_FORJOB.
Note: policy reservation or user reservation will override.

Parameters:
jobID - ID for job to reserve for

setReserveForUser

public void setReserveForUser(java.lang.String userID)
Set the user ID to reserve the provisioned resource for. Default is no user. If set the mode of the provision will be MODE_FORUSER and the jobid reservation settings will ignored.
Note: policy reservation will override

Parameters:
userID - ID of user to reserve for

setIdleTimeout

public void setIdleTimeout(int idleTimeout)
Set idle timeout for provisioned resource. Default is value of resource.provisioned.timeout

Parameters:
idleTimeout - Idle timeout in seconds for provisioned resource

setPriority

public void setPriority(java.lang.String priority)
Set a priority for VM host allocation for this provision using supplied string. Default is the user's priority.

Parameters:
priority - Priority to set in the user's band

setPriority

public void setPriority(int priority)
Set a priority for VM host allocation for this provision using supplied integer constant. Default is the user's priority.

Parameters:
priority - Priority to set in the user's band

setReserveWithPolicy

public void setReserveWithPolicy(java.lang.String policyText)
Set a policy to use for reserving the provisioned resource. Default is no policy. If set the mode of the provision will be MODE_WITHPOLICY and the user and jobid reservation settings will be ignored.

Parameters:
policyText - Policy text

setHost

public void setHost(java.lang.String host)
Set the host to provision the resource on. Default is to provision on the affiliated host.

Parameters:
host - ID of host to provision on

setRepository

public void setRepository(java.lang.String repository)
Set the repository to provision the resource on. Default is to use the same repository as source.

Parameters:
repository - ID of repository to provision on

setNetworkMapping

public void setNetworkMapping(org.python.core.PyDictionary mapping)
Set the vnic to network mapping to use for provisioning.

Supplied dictionary maps the network interfaces to network objects.

Example to set a new network mapping for a VM:

       vm = getMatrix().getGridObject(TYPE_RESOURCE,VM)
       spec = ProvisionSpec()
       spec.setNetworkMapping( { "suse10_vnic1" : "eth2" } )
       vm.provision(spec)
 

Parameters:
mapping - Dictionary of vnic to network pairs

setAssignHostImmediately

public void setAssignHostImmediately(boolean value)
Set whether to wait or assign the host immediately. Default is false.

Parameters:
value - True to assign immediately, false to wait

setFailToAlternativeHost

public void setFailToAlternativeHost(boolean value)
Set whether when failing over a VM other hosts can be considered. This only has effect if a fixed host is being specified. Default is true.

Parameters:
value - True to consider alternative hosts in failover condition.

setFailToAlternativeRepository

public void setFailToAlternativeRepository(boolean value)
Set whether when failing over a VM other repositories can be considered. This only has effect if a fixed repository is being specified. Default is true.

Parameters:
value - True to consider alternative repositories in failover condition.

setFailToAlternativeNetwork

public void setFailToAlternativeNetwork(boolean value)
Set whether when failing over a VM other networks can be considered. This only has effect if a fixed network is being specified. Default is true.

Parameters:
value - True to consider alternative networks in failover condition.

setUseAutoprep

public void setUseAutoprep(boolean value)
Set whether to use the autoprep facts on the resource for creating the new VM.
Default is True. False indicates to not.

Parameters:
value - True to use autoprep, false to not

setAutoprep

public void setAutoprep(org.python.core.PyDictionary autoprep)
Set facts for personalizing the new VM.
The supplied facts will override any facts defined on the source resource.

Parameters:
autoprep - Dictionary of fact name and value to use for creating the VM


Copyright (c) 2011 Novell, Inc. All rights reserved.