From 3861122c53489b052e5098c532c8a49f219401ac Mon Sep 17 00:00:00 2001 From: DeWayne Filppi Date: Tue, 16 Jul 2013 15:15:18 -0700 Subject: [PATCH 1/2] added MEDIUM_LINUX template --- .../resources/clouds/ec2/ec2-cloud.groovy | 308 ++++++++++-------- 1 file changed, 173 insertions(+), 135 deletions(-) diff --git a/esc/src/main/resources/clouds/ec2/ec2-cloud.groovy b/esc/src/main/resources/clouds/ec2/ec2-cloud.groovy index 678855fdeb..e4da769260 100644 --- a/esc/src/main/resources/clouds/ec2/ec2-cloud.groovy +++ b/esc/src/main/resources/clouds/ec2/ec2-cloud.groovy @@ -20,11 +20,11 @@ cloud { managementMachineTemplate "SMALL_LINUX" // Optional. Indicates whether internal cluster communications should use the machine private IP. Defaults to true. connectToPrivateIp true - + // Optional. Path to folder where management state will be written. Null indicates state will not be written. persistentStoragePath persistencePath - - + + } /************* @@ -78,151 +78,189 @@ 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 5 - path "/storage" - namePrefix "cloudify-storage-volume" - deviceName "/dev/sdc" - fileSystemType "ext4" - custom ([:]) - } - ]) + + templates ([ + + SMALL_BLOCK : storageTemplate{ + deleteOnExit true + size 5 + path "/storage" + namePrefix "cloudify-storage-volume" + deviceName "/dev/sdc" + fileSystemType "ext4" + custom ([:]) + } + ]) } cloudCompute { - + /*********** * Cloud machine templates available with this cloud. */ templates ([ - // Mandatory. Template Name. - SMALL_LINUX : computeTemplate{ - // Mandatory. Image ID. - imageId linuxImageId - // Mandatory. Files from the local directory will be copied to this directory on the remote machine. - remoteDirectory "/home/ec2-user/gs-files" - // Mandatory. Amount of RAM available to machine. - machineMemoryMB 1600 - // Mandatory. Hardware ID. - hardwareId hardwareId - // Optional. 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 "ec2-user" - // 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 ([ - "securityGroups" : ["default"]as String[], - "keyPair" : keyPair - ]) - - // 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.ec2.ami-query":"", - "jclouds.ec2.cc-ami-query":""]) - - // enable sudo. - privileged true - - - - }, - SMALL_UBUNTU : computeTemplate{ - // Mandatory. Image ID. - imageId ubuntuImageId - - // 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 1600 - // Mandatory. Hardware ID. - hardwareId hardwareId - // Optional. 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 "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 ([ - "securityGroups" : ["default"]as String[], - "keyPair" : keyPair - ]) - - // 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.ec2.ami-query":"", - "jclouds.ec2.cc-ami-query":""]) - - // enable sudo. - privileged true - - - - }, - - MEDIUM_UBUNTU : computeTemplate{ - // Mandatory. Image ID. - imageId ubuntuImageId - - // 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 3500 - // Mandatory. Hardware ID. - hardwareId hardwareId - // Optional. 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 "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 ([ - "securityGroups" : ["default"]as String[], - "keyPair" : keyPair - ]) - - // 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.ec2.ami-query":"", - "jclouds.ec2.cc-ami-query":""]) - - // enable sudo. - privileged true - } - - + // Mandatory. Template Name. + SMALL_LINUX : computeTemplate{ + // Mandatory. Image ID. + imageId linuxImageId + // Mandatory. Files from the local directory will be copied to this directory on the remote machine. + remoteDirectory "/home/ec2-user/gs-files" + // Mandatory. Amount of RAM available to machine. + machineMemoryMB 1600 + // Mandatory. Hardware ID. + hardwareId hardwareId + // Optional. 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 "ec2-user" + // 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 ([ + "securityGroups" : ["default"]as String[], + "keyPair" : keyPair + ]) + + // 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.ec2.ami-query":"", + "jclouds.ec2.cc-ami-query":""]) + + // enable sudo. + privileged true + + + + }, + + MEDIUM_LINUX : computeTemplate{ + // Mandatory. Image ID. + imageId linuxImageId + // Mandatory. Files from the local directory will be copied to this directory on the remote machine. + remoteDirectory "/home/ec2-user/gs-files" + // Mandatory. Amount of RAM available to machine. + machineMemoryMB 3500 + // Mandatory. Hardware ID. + hardwareId "m1.medium" + // Optional. 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 "ec2-user" + // 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 ([ + "securityGroups" : ["default"]as String[], + "keyPair" : keyPair + ]) + + // 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.ec2.ami-query":"", + "jclouds.ec2.cc-ami-query":""]) + + // enable sudo. + privileged true + + + }, + + SMALL_UBUNTU : computeTemplate{ + // Mandatory. Image ID. + imageId ubuntuImageId + + // 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 1600 + // Mandatory. Hardware ID. + hardwareId hardwareId + // Optional. 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 "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 ([ + "securityGroups" : ["default"]as String[], + "keyPair" : keyPair + ]) + + // 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.ec2.ami-query":"", + "jclouds.ec2.cc-ami-query":""]) + + // enable sudo. + privileged true + + + + }, + + MEDIUM_UBUNTU : computeTemplate{ + // Mandatory. Image ID. + imageId ubuntuImageId + + // 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 3500 + // Mandatory. Hardware ID. + hardwareId hardwareId + // Optional. 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 "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 ([ + "securityGroups" : ["default"]as String[], + "keyPair" : keyPair ]) - + + // 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.ec2.ami-query":"", + "jclouds.ec2.cc-ami-query":""]) + + // enable sudo. + privileged true + } + + + ]) + } /***************** * Optional. Custom properties used to extend existing drivers or create new ones. */ custom ([ - "org.cloudifysource.clearRemoteDirectoryOnStart" : true + "org.cloudifysource.clearRemoteDirectoryOnStart" : true ]) -} \ No newline at end of file +} From f5960126639e53eef5c9fd5dfc06b8d9ff6c8a77 Mon Sep 17 00:00:00 2001 From: DeWayne Filppi Date: Tue, 16 Jul 2013 15:23:39 -0700 Subject: [PATCH 2/2] added medium-linux template --- .../main/resources/clouds/hp/hp-cloud.groovy | 259 +++++++++++------- 1 file changed, 153 insertions(+), 106 deletions(-) diff --git a/esc/src/main/resources/clouds/hp/hp-cloud.groovy b/esc/src/main/resources/clouds/hp/hp-cloud.groovy index 57a0e2177e..ae51bbb985 100644 --- a/esc/src/main/resources/clouds/hp/hp-cloud.groovy +++ b/esc/src/main/resources/clouds/hp/hp-cloud.groovy @@ -20,12 +20,12 @@ cloud { managementMachineTemplate "SMALL_LINUX" // Optional. Indicates whether internal cluster communications should use the machine private IP. Defaults to true. connectToPrivateIp true - + // Optional. Path to folder where management state will be written. Null indicates state will not be written. persistentStoragePath persistencePath } - - + + /************* * Provider specific information. @@ -81,118 +81,165 @@ cloud { } - + cloudStorage { - templates ([ - SMALL_BLOCK : storageTemplate{ - deleteOnExit true - size 1 - path "/storage" - namePrefix "cloudify-storage-volume" - deviceName "/dev/vdc" - fileSystemType "ext4" - custom ([:]) - } + templates ([ + SMALL_BLOCK : storageTemplate{ + deleteOnExit true + size 1 + path "/storage" + namePrefix "cloudify-storage-volume" + deviceName "/dev/vdc" + fileSystemType "ext4" + custom ([:]) + } ]) } - + cloudCompute { - + /*********** * Cloud machine templates available with this cloud. */ templates ([ - // Mandatory. Template Name. - SMALL_LINUX : computeTemplate{ - // Mandatory. Image ID. - imageId linuxImageId - - // file transfer protocol - fileTransfer org.cloudifysource.dsl.cloud.FileTransferModes.SFTP - - // Mandatory. Files from the local directory will be copied to this directory on the remote machine. - remoteDirectory "/home/root/gs-files" - // Mandatory. Amount of RAM available to machine. - machineMemoryMB 1600 - // Mandatory. Hardware ID. - hardwareId hardwareId - // 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" - // 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" : [securityGroup]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.keystone.credential-type":"apiAccessKeyCredentials" - ]) - - // 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" - - }, - SMALL_UBUNTU : computeTemplate{ - // Mandatory. Image ID. - imageId ubuntuImageId - - // file transfer protocol - fileTransfer org.cloudifysource.dsl.cloud.FileTransferModes.SFTP - - // 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 1600 - // Mandatory. Hardware ID. - hardwareId hardwareId - // 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 remote machine. Remove this line if key files - // are not used. - keyFile keyFile - - 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" : [securityGroup]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.keystone.credential-type":"apiAccessKeyCredentials" - ]) - - // 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" - } - - + // Mandatory. Template Name. + SMALL_LINUX : computeTemplate{ + // Mandatory. Image ID. + imageId linuxImageId + + // file transfer protocol + fileTransfer org.cloudifysource.dsl.cloud.FileTransferModes.SFTP + + // Mandatory. Files from the local directory will be copied to this directory on the remote machine. + remoteDirectory "/home/root/gs-files" + // Mandatory. Amount of RAM available to machine. + machineMemoryMB 1600 + // Mandatory. Hardware ID. + hardwareId hardwareId + // 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" + // 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" : [securityGroup]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.keystone.credential-type":"apiAccessKeyCredentials" + ]) + + // 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" + + }, + MEDIUM_LINUX : computeTemplate{ + // Mandatory. Image ID. + imageId imageId + + + // file transfer protocol + fileTransfer org.cloudifysource.dsl.cloud.FileTransferModes.SFTP + + // Mandatory. Files from the local directory will be copied to this directory on the remote machine. + remoteDirectory "/home/root/gs-files" + // Mandatory. Amount of RAM available to machine. + machineMemoryMB 3200 + // Mandatory. Hardware ID. + hardwareId "m1.medium" + // 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" + // 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" : ["test"]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.keystone.credential-type":"apiAccessKeyCredentials" + ]) + + // 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" + + } + + + SMALL_UBUNTU : computeTemplate{ + // Mandatory. Image ID. + imageId ubuntuImageId + + // file transfer protocol + fileTransfer org.cloudifysource.dsl.cloud.FileTransferModes.SFTP + + // 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 1600 + // Mandatory. Hardware ID. + hardwareId hardwareId + // 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 remote machine. Remove this line if key files + // are not used. + keyFile keyFile + + 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" : [securityGroup]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.keystone.credential-type":"apiAccessKeyCredentials" + ]) + + // 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" + } + + + ]) + } @@ -200,4 +247,4 @@ cloud { * Optional. Custom properties used to extend existing drivers or create new ones. */ custom ([:]) -} \ No newline at end of file +}