runInstances

The runInstances method is used for provisioning and you must specify the BMC Cloud Lifecycle Management service offering name as image ID as the method argument. You can also use this method to onboard an Amazon Machine Instance (AMI) or Vitual Machine (VM) templates.

The following table depicts the tasks to be performed and the results while performing the onboarding or provisioning procedure using the runInstances method:

ProcedureTaskResult
Onboarding an AMI

Use the runInstances method for onboarding an AMI, by specifying ami id as image id in method.

While executing the runinstance method for onboarding an AMI, CLM AWS SDK performs the following tasks:

  • Creates installable resource and PDC using AMI.
  • Creates single tier service blueprint.
  • Creates service catalog and service offering.
Onboarding an on-premise template

Use the runInstances method for onboarding the on-premise templates, by specifying image id in IR-<TemplateName> format.

For example: To onboard RHEL6 template, you must specify the image id as IR-RHEL6.

While executing the runinstance method for onboarding an on-premise template, CLM AWS SDK performs the following tasks:

  • Creates single tier service blueprint.
  • Creates service catalog and service offering.
Provision a serviceUse the runInstances method to provision a service in BMC Cloud Lifecycle Management, by supplying service offering name as Image ID in the methodWhile executing the runinstance method for provisioning a service, CLM AWS SDK provisions a service in Amazon cloud or an on-premise cloud.

 

The onboarding facility is available for Cloud Administrators only. Some of the attributes or methods of AWS SDK are not supported by the runInstances method of CLM AWS SDK. See Request and Response section of this topic for details of AWS attributes or methods not supported. 

Before you begin

Prior to using the runInstances method, ensure that the following condition exists:

  • You have the AMI ID from the Amazon portal. See Consolidated list of configuration settings for Amazon provisioning for details.
  • You have supplied the configuration parameters to the CLMEC2Client constructor or have specified in the configuration file. See CLM AWS SDK syntax and usage for details.
  • (Applies for on-premise cloud while onboarding) On-premise template (for example: VMware template) must exist in BMC Server Automation (BSA) as virtual guest template and a corresponding product catalog (PDC) must be created in cloud database.
  • (Applies for on-premise cloud while onboarding) You must provide a name for service blueprint as configuration parameter in the <ImageId>.blueprintname=<Service Blueprint Name> format. Here you must replace <imageId> with name of template and the <blueprint name> with the name of service blueprint used. 

    Note

    Service blueprint name should not contain an image ID in it.

    For example: To onboard an image VMW-W2K8-64B-20GB you must have the configuration parameter in config.properties set as VMW-W2K8-64B-20GB.blueprintname=Windows 2008 Service.

Request

Using com.amazonaws.services.ec2.model.RunInstancesRequest

MethodUsage as per AWS SDKUsage as per CLM AWS SDK
withAdditionalInfo(String additionalInfo) 
Reserved.Not used in CLM AWS SDK.
withBlockDeviceMappings
(BlockDeviceMapping... blockDeviceMappings)
The block device mapping.Not used in CLM AWS SDK.  
Workaround: After performing the onboard operation, you must manually add the secondary disks in the service blueprint.
withBlockDeviceMappings
(Collection<BlockDeviceMapping> blockDeviceMappings) 
The block device mapping.Not used in CLM AWS SDK.  
Workaround: After performing the onboard operation, you must manually add the secondary disks in the service blueprint.
withClientToken(String clientToken) 
Unique, and a case-sensitive identifier provided to ensure the idempotency of the request.Not used in CLM AWS SDK as AWS Provider does not use it.

withDisableApiTermination(Boolean disableApiTermination) 
If you set this parameter to true, you cannot terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can.In AWS Provider this value is set to False. If the value is set to true, the AWS instances cannot be terminated using any program, REST, or CLM AWS SDK.
withEbsOptimized(Boolean ebsOptimized) 
Indicates whether the instance is optimized for EBS input output.Not used directly with CLM AWS SDK. This property is part of Instance Types available in AWS. For the AWS Provider, the property value is of boolean type and is decided on the basis of the instance type used in a service blueprint.
withIamInstanceProfile
(IamInstanceProfileSpecification iamInstanceProfile) 
The IAM instance profile.

Not used in CLM AWS SDK.

withImageId(String imageId) 
Amazon Machine Image ID (AMI ID).
  • If image id is a service offering name, CLM AWS SDK then provisions a service using it. 
  • If image id is an AMI ID, CLM AWS SDK then onboards an Amazon Machine Instance (AMI) in BMC Cloud Lifecycle Management as Installable Resource. 
  • If image id has a prefix IR- (For example: IR-RHEL6), CLM AWS SDK then considers it for an on-premise cloud provider and onboards the machine image.
withInstanceInitiatedShutdownBehavior
(ShutdownBehavior instanceInitiatedShutdownBehavior) 
Indicates whether an instance stops or terminates when you initiate shutdown of an instance (using the operating system command for system shutdown).Not used in CLM AWS SDK.
withInstanceInitiatedShutdownBehavior
(String instanceInitiatedShutdownBehavior) 
Indicates whether an instance stops or terminates when you initiate shutdown of an instance (using the operating system command for system shutdown).Not used in CLM AWS SDK.

withInstanceType
(InstanceType instanceType) 
The instance type.

It is of string data type and contains the name of instance type. For example: C1Medium ,C1Xlarge ,C32xlarge ,C34xlarge and so on. 

CLM AWS SDK uses this method while creating a service blueprint when onboarding an ami. Based on the instance type, the compute resources (CPU/RAM) value is decided in the service blueprint.

withInstanceType(String instanceType) 
The instance type.

It is of string data type and contains the name of instance type. For example: C1Medium ,C1Xlarge ,C32xlarge ,C34xlarge and so on. 

CLM AWS SDK uses this method while creating a service blueprint when onboarding an ami. Based on the instance type, the compute resources (CPU/RAM) value is decided in the service blueprint.

withKernelId(String kernelId) 
The ID of the kernel.Not used in CLM AWS SDK.
withKeyName(String keyName) 
The name of the key pair.

Used while provisioning a VM, if the service blueprint contains a deployment parameter with name BmcSshInstanceKey.

withMaxCount(Integer maxCount) 
The maximum number of instances to be launched.Defines the number of instances to be instantiated for a request or a reservation. 
withMinCount(Integer minCount) 
The minimum number of instances to launch.Defines the number of instances to be instantiated for a request or a reservation. 
withMonitoring(Boolean monitoring) 
The monitoring for the instance.

Not used directly with CLM AWS SDK.

Note: You must manually edit the service blueprint to enable monitoring. 

withNetworkInterfaces
(Collection<InstanceNetworkInterfaceSpecification> networkInterfaces) 
One or more network interfaces.NICs and tags are created while creating a service blueprint. These NICs are based out of Logical Networks in Logical Hosting Environment (LHE). LHE value is received as a config parameter from the config file. 
withNetworkInterfaces
(InstanceNetworkInterfaceSpecification... networkInterfaces) 
One or more network interfaces.NICs and tags are created while creating a service blueprint. These NICs are based out of Logical Networks in Logical Hosting Environment. LHE value is received as a config parameter from the config file.
withPlacement(Placement placement) 
The placement for the instance.Placement of the instance is the Availability zone or VPC id stored in External Id of LDC while onboarding LHE. Not used directly with CLM AWS SDK. Based on the selected LHE the placement of the instance is decided.
withPrivateIpAddress
(String privateIpAddress) 
[EC2-VPC] The primary IP address.Not used in CLM AWS SDK.
withRamdiskId(String ramdiskId) 
The ID of the RAM disk.Not used in CLM AWS SDK.
withSecurityGroupIds
(Collection<String> securityGroupIds) 
One or more security group IDs.While provisioning using the AWS Provider, a new security group is created for each new instance based on the LHE, else a default security group is used. 
withSecurityGroupIds
(String... securityGroupIds) 
One or more security group IDs.While provisioning using the AWS Provider, a new security group is created for each new instance based on the LHE, else a default security group is used.  
withSecurityGroups
(Collection<String> securityGroups) 
[EC2-Classic, default VPC] One or more security group names.While provisioning using the AWS Provider, a new security group is created for each new instance based on the LHE, else a default security group is used. 
withSecurityGroups
(String... securityGroups) 
[EC2-Classic, default VPC] One or more security group names.While provisioning using the AWS Provider, a new security group is created for each new instance based on the LHE, else a default security group is used.  
withSubnetId(String subnetId) 
[EC2-VPC] The ID of the subnet to launch the instance into.

Not used directly with CLM AWS SDK. Subnet ID/ VPC ID is picked from the LHE selected for provisioning.

Note: You can specify the LHE to be used in the config file.

withUserData(String userData) 
The Base64-encoded MIME user data for the instances.Not used in CLM AWS SDK.

Using com.bmc.cloud.sdk.aws.model.RunServiceInstancesRequest

Extends: com.amazonaws.services.ec2.model.RunInstancesRequest

MethodUsage as per AWS SDKUsage as per CLM AWS SDKRemarks
getName()Not applicable.Name of the service.If left blank, defaults to Login User Id + "-"  + Host Name Prefix
getUsername()Not applicable.If AWS Provider attribute Enroll Server is set, then a user account is created with this username.If left blank, defaults to cloud
setPassword(String password)
Not applicable. If AWS Provider attribute Enroll Server is set, then a user account is created with this password.If left blank, defaults to cloud
getHostnamePrefix()
Not applicable. Applied to the VM name. If left blank, defaults to aws
getDecommissionDate()Not applicable. Decommission date of a service.Defaults to blank
getQuantity()MaxCountQuantity of service. Defaults to 1

Response

com.bmc.cloud.sdk.aws.model.RunServiceInstancesResult

Extends: com.amazonaws.services.ec2.model.RunInstancesResult

MethodBelongs To Usage as per CLM AWS SDK                   Remarks
getServiceResultList()
CLM AWS SDK 

List of RunSingleServiceInstancesResult

Gets the list of Service instance(s) created as result of CLMEC2Client.runInstances(com.amazonaws.services.ec2.model.RunInstancesRequest) operation.
Each instance of RunSingleServiceInstancesResult represents one Service instance. 
getReservation()
AWS Reservation of AWS.Resource sets present in the service.

com.bmc.cloud.sdk.aws.model.RunSingleServiceInstancesResult

Extends: None

This is CLM AWS SDK construct only. Does not have direct mapping to AWS. Represents one service instance corresponding to collection of Reservation created as result of CLMEC2Client.runInstances(com.amazonaws.services.ec2.model.RunInstancesRequest) operation.

MethodBelongs To Usage as per AWS SDK Usage as per CLM AWS SDK                    Remarks
getServiceId()
CLM AWS SDKNot applicable. ServiceGets the service instance ID for this object.
getReservationList()
CLM AWS SDKList of AWS Reservation.Resource sets present in the service.Resource sets present in the service.

com.amazonaws.services.ec2.model.Reservation

This is an AWS entity. Same class is used in CLM AWS SDK. Logically it is mapped to BMC Cloud Lifecycle Management resource set.

MethodBelongs To Usage as per AWS SDK Usage as per CLM AWS SDK                    Remarks
getReservationId()AWS The ID of the reservation.Resource set guid.
getOwnerId()
AWS The ID of the AWS account that owns the reservation.Service owner ID.User who invokes SDK method will be owner. 
getRequesterId()
AWS The ID of the requester that launched the instances on your behalf (for example, AWS Management Console or Auto Scaling).BMC Cloud Lifecycle Management user who invokes SDK attributes. 
getInstances()
AWS One or more instances.List of compute resource.Server in resource set. 

com.bmc.cloud.sdk.aws.model.ServerInstance

Extends: com.amazonaws.services.ec2.model.Instance

MethodBelongs  To   Usage as per AWS SDK    Usage as per CLM AWS SDK                      Remarks
getCpuCount() 
CLM AWS SDKNot applicable.Gets the number of CPU assigned to this server instance 
getMemory() 
CLM AWS SDKNot applicable.Gets the memory (in MB) assigned as RAM to this server instance 
getName() 
CLM AWS SDKNot applicable.Gets the name of server instance in BMC Cloud Lifecycle Management.  
getServerId() 
CLM AWS SDKNot applicable. Gets the server instance ID.  
getTierName() 
CLM AWS SDKNot applicable.Gets the name of resource set created in BMC Cloud Lifecycle Management.  
getTierId() 
CLM AWS SDKNot applicable. Gets the id of resource set created in BMC Cloud Lifecycle Management. 
getServiceName() 
CLM AWS SDKNot applicable. Gets the service instance name containing this server instance   
getServiceId() CLM AWS SDKNot applicable.Gets the service instance id containing this server instance 
getAmiLaunchIndex()
AWSThe AMI launch index, which can be used to find this instance in the launch group.This will not be returned by CLM AWS SDK. 
getClientToken() 
AWSThe idempotency token provided when you launched the instance.This will not be returned by CLM AWS SDK.  
getEbsOptimized() 
AWSIndicates whether the instance is optimized for EBS I/O.In CLM AWS SDK, an instance will be EBS optimized depending on its instance type.Following instance type are considered for EBS optimized: 
  • m3.xlarge
  • m3.2xlarge
  • m3.2xlarge
  • c3.xlarge
  • c3.2xlarge
  • c3.4xlarge
  • g2.2xlarge
  • r3.xlarge
  • r3.2xlarge
  • r3.4xlarge
  • i2.xlarge
  • i2.2xlarge
  • i2.4xlarge
getHypervisor() 
AWSThe hypervisor type of the instance.This will not be returned by CLM AWS SDK.  
getIamInstanceProfile() 
AWSThe IAM instance profile associated with the instance. This will not be returned by CLM AWS SDK.  
getInstanceLifecycle() 
AWSIndicates whether this is a Spot Instance. This will not be returned by CLM AWS SDK.  
getKeyName() 
AWSThe name of the key pair, if this instance was launched with an associated key pair. The name of the key pair, if this instance was launched with an associated key pair. For provisioning case, ensure that a deployment parameter (with name BmcSshInstanceKey) is created in a service blueprint.  



getLaunchTime() 
AWSThe time the instance was launched. Server create time. 
getMonitoring() 
AWSThe monitoring information for the instance. The monitoring information for the instance. Ensure that the property Enable Monitoring is selected in a service blueprint.
getPublicIpAddress() 
AWS Public IP Address of instance. Public IP address of the instance. Based on the configuration of service blueprint.
getPrivateIpAddress() 
AWS Private IP Address of instance List of private IP addresses based on blueprint configuration.  
getNetworkInterfaces() 
AWS List of com.amazonaws.services.ec2.model.InstanceNetworkInterfaceList of com.amazonaws.services.ec2.model.InstanceNetworkInterfaceNICs are configured on an instance based on the configuration of service blueprint.
getVpcId() 
AWS The ID of the VPC in which the instance is running.The ID of the network container selected for provisioning in BMC Cloud Lifecycle Management. 
getInstanceId() 
AWS The ID of the instance.ID of server in BMC Cloud Lifecycle Management. 
getArchitecture() 
AWS The architecture of the image.Architecure of image obtained from server.  
getBlockDeviceMappings() 
AWS List of com.amazonaws.services.ec2.model.InstanceBlockDeviceMappingList of com.amazonaws.services.ec2.model.InstanceBlockDeviceMapping
obtained by transforming server's LocalDisk objects in BMC Cloud Lifecycle Management.
 
getState()
AWS The current state of the instance.
com.amazonaws.services.ec2.model.InstanceState
Server's ProvisionedResourceState 
getPlacement() 
AWS The location where the instance launched.
com.amazonaws.services.ec2.model.Placement
The location where the instance launched.For on-premise cloud provider, this returns the network container information used for provisioning in the BMC Cloud Lifecycle Management.
getImageId() 
AWS The ID of the AMI used to launch the instance.The ID of the AMI used to launch the instance.  
getKernelId() 
AWS The kernel associated with this instance.The kernel associated with this instance.Same as AWS. 
getPlatform() 
AWS The value is Windows for Windows instances; otherwise blank.The value is Windows for Windows instances; otherwise blank. 
getInstanceType() 
AWS The instance type.Instance Type. Same as AWS. 
getPrivateDnsName()
AWSThe private DNS name assigned to the instance.This will not be returned by CLM AWS SDK.  
getProductCodes()
AWSThe product codes attached to this instance.This will not be returned by CLM AWS SDK. 
getPublicDnsName() 
AWSThe public DNS name assigned to the instance. This will not be returned by CLM AWS SDK.  
getRamdiskId() 
AWSThe RAM disk associated with this instance. This will not be returned by CLM AWS SDK.  
getRootDeviceName() 
AWSThe root device name. For example: /dev/sda1The root device name. For example: /dev/sda1 
getRootDeviceType() 
AWSThe root device type used by the AMI. The root device type used by the AMI.  
getSecurityGroups() 
AWSOne or more security groups for the instance. One or more security groups for the instance.  
getSourceDestCheck() 
AWSSpecifies whether to enable an instance launched in a VPC to perform NAT. This will not be returned by CLM AWS SDK.  
getSpotInstanceRequestId()
AWSThe ID of the spot instance request. This will not be returned by CLM AWS SDK.  

Related topic

CLM AWS SDK use cases

Was this page helpful? Yes No Submitting... Thank you

Comments