com.novell.zos.jdl
Class BuildSpec

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

public class BuildSpec
extends java.lang.Object

Defines the attributes for building a new VM. An instance of this class is passed to resource.build().

Example of using BuildSpec for creating a new VM:

      vm = getMatrix().createResource("newvm",ResourceInfo.TYPE_VM_INSTANCE,True)
      vm.setFact("resource.provisioner.job", "xen" )
      vm.setFact("resource.vm.cpu.architecture","x86_64")
      vm.setFact("resource.vm.hvm",False)
      vm.setFact("resource.vm.vdisksize",8192)
      vm.setFact("resource.vm.memory",1024)
      vm.setFact("resource.os.family","linux")
      spec = BuildSpec()
      spec.setConfig( { "response" : responseFileText } )
      vm.build(spec)
 

Where 'spec' is the required key and value pairs for the dictionary passed to the provisioning adapter and used to create the VM. It is saved on the VM under the resource.vm.spec fact. Setting this fact directly is an alternative to supplying the configuation in the BuildSpec but the BuildSpec will override the fact contents.

E.g.

      "response"  :   text for VM builder tool
 


Constructor Summary
BuildSpec()
          Construct a default BuildSpec.
 
Method Summary
 void setAssignHostImmediately(boolean value)
          Set whether to wait or assign the host immediately.
 void setConfig(org.python.core.PyDictionary config)
          Set configuration for building the new VM.
 void setHost(java.lang.String host)
          If set, forces the use of the specified VM Host to build the VM on.
 void setNetworkMapping(org.python.core.PyDictionary mapping)
          Set the nic to network mapping to use for buildng the new VM.
 void setPriority(int priority)
          Set a priority for vmhost allocation for this build operation using supplied integer constant.
 void setPriority(java.lang.String priority)
          Set a priority for vmhost allocation for this build operation using supplied string.
 void setRepository(java.lang.String repository)
          If set, forces the use of the specified Repository to build the VM in.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuildSpec

public BuildSpec()
Construct a default BuildSpec.

Method Detail

setRepository

public void setRepository(java.lang.String repository)
If set, forces the use of the specified Repository to build the VM in. If not set, the default is to automatically select an appropriate Repository.

Parameters:
repository - Name of repository to create in

setConfig

public void setConfig(org.python.core.PyDictionary config)
Set configuration for building the new VM.

Parameters:
config - Dictionary of name and value pairs to use for building the VM

setNetworkMapping

public void setNetworkMapping(org.python.core.PyDictionary mapping)
Set the nic to network mapping to use for buildng the new VM.

Supplied dictionary maps the network interfaces to network objects.

Parameters:
mapping -

setHost

public void setHost(java.lang.String host)
If set, forces the use of the specified VM Host to build the VM on. If not set, the default is to automatically select an appropriate VM Host.

Parameters:
host - ID of Vm Host to create on

setPriority

public void setPriority(java.lang.String priority)
Set a priority for vmhost allocation for this build operation 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 vmhost allocation for this build operation using supplied integer constant. Default is the user's priority.

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

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


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