Skip to content

Instantly share code, notes, and snippets.

@josh-wrale
Created May 14, 2013 03:26
Show Gist options
  • Save josh-wrale/5573451 to your computer and use it in GitHub Desktop.
Save josh-wrale/5573451 to your computer and use it in GitHub Desktop.
openstack-cloud.groovy with volume attachments
/***************
* Cloud configuration file for the Amazon ec2 cloud. Uses the default jclouds-based cloud driver.
* See org.cloudifysource.dsl.cloud.Cloud for more details.
* @author barakme
*
*/
cloud {
// Mandatory. The name of the cloud, as it will appear in the Cloudify UI.
name = "openstack"
/********
* General configuration information about the cloud driver implementation.
*/
configuration {
// Optional. The cloud implementation class. Defaults to the build in jclouds-based provisioning driver.
className "org.cloudifysource.esc.driver.provisioning.jclouds.DefaultProvisioningDriver"
storageClassName "org.cloudifysource.esc.driver.provisioning.storage.openstack.OpenstackStorageDriver"
// Optional. The template name for the management machines. Defaults to the first template in the templates section below.
managementMachineTemplate "XLARGE_MANAGEMENT_PUBLIC"
// Optional. Indicates whether internal cluster communications should use the machine private IP. Defaults to true.
connectToPrivateIp true
bootstrapManagementOnPublicIp true
// Optional. Path to folder where management state will be written. Null indicates state will not be written.
persistentStoragePath persistencePath
}
/*************
* Provider specific information.
*/
provider {
// Mandatory. The name of the provider.
// When using the default cloud driver, maps to the Compute Service Context provider name.
provider "openstack-nova"
// Optional. The HTTP/S URL where cloudify can be downloaded from by newly started machines. Defaults to downloading the
// cloudify version matching that of the client from the cloudify CDN.
// Change this if your compute nodes do not have access to an internet connection, or if you prefer to use a
// different HTTP server instead.
// IMPORTANT: the default linux bootstrap script appends '.tar.gz' to the url whereas the default windows script appends '.zip'.
// Therefore, if setting a custom URL, make sure to leave out the suffix.
// cloudifyUrl "http://repository.cloudifysource.org/org/cloudifysource/2.5.0-RELEASE/gigaspaces-cloudify-2.5.0-ga-b4010.zip"
// Mandatory. The prefix for new machines started for servies.
machineNamePrefix "cloudify-agent-"
// Optional. Defaults to true. Specifies whether cloudify should try to deploy services on the management machine.
// Do not change this unless you know EXACTLY what you are doing.
//
managementOnlyFiles (["exampleboss.pem"])
// Optional. Logging level for the intenal cloud provider logger. Defaults to INFO.
sshLoggingLevel "WARNING"
// Mandatory. Name of the new machine/s started as cloudify management machines. Names are case-insensitive.
managementGroup "cloudify-manager"
// Mandatory. Number of management machines to start on bootstrap-cloud. In production, should be 2. Can be 1 for dev.
numberOfManagementMachines 1
reservedMemoryCapacityPerMachineInMB 1024
}
/*************
* Cloud authentication information
*/
user {
// Optional. Identity used to access cloud.
// When used with the default driver, maps to the identity used to create the ComputeServiceContext.
//user user
user "${tenant}:${user}"
// Optional. Key used to access cloud.
// When used with the default driver, maps to the credential used to create the ComputeServiceContext.
apiKey apiKey
}
cloudStorage {
templates ([
SMALL_BLOCK : storageTemplate{
deleteOnExit true
size 1
path "/volume-1"
namePrefix "cloudify-storage-volume"
deviceName "/dev/vdb"
fileSystemType "ext4"
custom (["openstack.storage.volume.zone": "nova"])
}
])
}
cloudCompute {
/***********
* Cloud machine templates available with this cloud.
*/
templates ([
// Mandatory. Template Name.
XLARGE_MANAGEMENT_PUBLIC : computeTemplate{
// Mandatory. Image ID.
imageId linuxImageId
// Mandatory. Files from the local directory will be copied to this directory on the remote machine.
remoteDirectory "/home/ubuntu/gs-files"
// Mandatory. Amount of RAM available to machine.
machineMemoryMB 16050
// Mandatory. Hardware ID.
hardwareId hardwareId
// Location ID.
locationId locationId
// Mandatory. All files from this LOCAL directory will be copied to the remote machine directory.
localDirectory "upload"
// Optional. Name of key file to use for authenticating to the remot machine. Remove this line if key files
// are not used.
keyFile keyFile
//username "root"
username "ubuntu"
// Additional template options.
// When used with the default driver, the option names are considered
// method names invoked on the TemplateOptions object with the value as the parameter.
options ([
"securityGroupNames" : ["cloudify-mgmt"]as String[],
"keyPairName" : keyPair,
"generateKeyPair": false,
"autoAssignFloatingIp": true
])
// Optional. Overrides to default cloud driver behavior.
// When used with the default driver, maps to the overrides properties passed to the ComputeServiceContext a
overrides ([
"jclouds.endpoint": openstackUrl
])
// enable sudo.
privileged true
// optional. A native command line to be executed before the cloudify agent is started.
// initializationCommand "echo Cloudify agent is about to start"
},
XLARGE_AGENTS_PUBLIC : computeTemplate{
// Mandatory. Image ID.
imageId linuxImageId
// Mandatory. Files from the local directory will be copied to this directory on the remote machine.
remoteDirectory "/home/ubuntu/gs-files"
// Mandatory. Amount of RAM available to machine.
machineMemoryMB 16050
// Mandatory. Hardware ID.
hardwareId hardwareId
// Location ID.
locationId locationId
// Mandatory. All files from this LOCAL directory will be copied to the remote machine directory.
localDirectory "upload"
// Optional. Name of key file to use for authenticating to the remot machine. Remove this line if key files
// are not used.
keyFile keyFile
//username "root"
username "ubuntu"
// Additional template options.
// When used with the default driver, the option names are considered
// method names invoked on the TemplateOptions object with the value as the parameter.
options ([
"securityGroupNames" : ["cloudify-agents-public"]as String[],
"keyPairName" : keyPair,
"generateKeyPair": false,
"autoAssignFloatingIp": true
])
// Optional. Overrides to default cloud driver behavior.
// When used with the default driver, maps to the overrides properties passed to the ComputeServiceContext a
overrides ([
"jclouds.endpoint": openstackUrl
])
// enable sudo.
privileged true
// optional. A native command line to be executed before the cloudify agent is started.
// initializationCommand "echo Cloudify agent is about to start"
},
XLARGE_AGENTS_PRIVATE : computeTemplate{
// Mandatory. Image ID.
imageId linuxImageId
// Mandatory. Files from the local directory will be copied to this directory on the remote machine.
remoteDirectory "/home/ubuntu/gs-files"
// Mandatory. Amount of RAM available to machine.
machineMemoryMB 16050
// Mandatory. Hardware ID.
hardwareId hardwareId
// Location ID.
locationId locationId
// Mandatory. All files from this LOCAL directory will be copied to the remote machine directory.
localDirectory "upload"
// Optional. Name of key file to use for authenticating to the remot machine. Remove this line if key files
// are not used.
keyFile keyFile
//username "root"
username "ubuntu"
// Additional template options.
// When used with the default driver, the option names are considered
// method names invoked on the TemplateOptions object with the value as the parameter.
options ([
"securityGroupNames" : ["cloudify-agents-private"]as String[],
"keyPairName" : keyPair,
"generateKeyPair": false,
"autoAssignFloatingIp": false
])
// Optional. Overrides to default cloud driver behavior.
// When used with the default driver, maps to the overrides properties passed to the ComputeServiceContext a
overrides ([
"jclouds.endpoint": openstackUrl
])
// enable sudo.
privileged true
// optional. A native command line to be executed before the cloudify agent is started.
// initializationCommand "echo Cloudify agent is about to start"
}
])
}
/*****************
* Optional. Custom properties used to extend existing drivers or create new ones.
*/
custom ([
"openstack.wireLog": "true"
])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment