This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Override | |
| public boolean stopMachine(final String ip, final long duration, final TimeUnit unit) | |
| throws InterruptedException, TimeoutException, CloudProvisioningException { | |
| final long endTime = calcEndTimeInMillis( | |
| duration, unit); | |
| if (isStopRequestRecent(ip)) { | |
| return false; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private String createServer(final String token, final CloudTemplate serverTemplate) | |
| throws OpenstackException { | |
| final String serverName = this.serverNamePrefix + System.currentTimeMillis(); | |
| final String securityGroup = getCustomTemplateValue( | |
| serverTemplate, OPENSTACK_SECURITYGROUP, null, false); | |
| final String keyPairName = getCustomTemplateValue( | |
| serverTemplate, OPENSTACK_KEY_PAIR, null, false); | |
| // Start the machine! | |
| final String json = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Override | |
| public void setConfig(final Cloud cloud, final String templateName, final boolean management) { | |
| super.setConfig( | |
| cloud, templateName, management); | |
| if (this.management) { | |
| this.serverNamePrefix = this.cloud.getProvider().getManagementGroup(); | |
| } else { | |
| this.serverNamePrefix = this.cloud.getProvider().getMachineNamePrefix(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| user { | |
| user Your_User_Here | |
| apiKey Your_API_Key_Here | |
| keyFile Your_PEM_File_Name_Here | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private String createServer(final String token, final CloudTemplate serverTemplate) | |
| throws OpenstackException { | |
| final String serverName = this.serverNamePrefix + System.currentTimeMillis(); | |
| final String securityGroup = getCustomTemplateValue( | |
| serverTemplate, OPENSTACK_SECURITYGROUP, null, false); | |
| final String keyPairName = getCustomTemplateValue( | |
| serverTemplate, OPENSTACK_KEY_PAIR, null, false); | |
| // Start the machine! | |
| final String json = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public MachineDetails[] startManagementMachines(final long duration, final TimeUnit unit) | |
| throws TimeoutException, CloudProvisioningException { | |
| final String token = createAuthenticationToken(); | |
| final long endTime = calcEndTimeInMillis( | |
| duration, unit); | |
| final int numOfManagementMachines = cloud.getProvider().getNumberOfManagementMachines(); | |
| // thread pool - one per machine | |
| final ExecutorService executor = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cloud { | |
| name = "cloudstack" | |
| configuration { | |
| className "org.cloudifysource.esc.driver.provisioning.jclouds.DefaultProvisioningDriver" | |
| managementMachineTemplate "CentOS5_4GS_JAVA" | |
| connectToPrivateIp true | |
| bootstrapManagementOnPublicIp false | |
| remoteUsername "root" | |
| remotePassword "Your Password Here" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cloud { | |
| // Mandatory. The name of the cloud, as it will appear in the Cloudify UI. | |
| name = "ec2" | |
| /******** | |
| * 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public interface ProvisioningDriver { | |
| /************** | |
| * Called once on startup of the cloud driver, passing the cloud configuration to it. | |
| * | |
| * @param cloudTemplate | |
| * @param cloud | |
| * | |
| * @param config The configuration settings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| customCommands ([ | |
| "add-node" : { node, instanceID -> | |
| def proxyConfigFile = new File(context.serviceDirectory + "/install/conf/extra/httpd-proxy-balancer.conf") | |
| def config = proxyConfigFile.text | |
| def modifiedConfig = config.replace("# Generated code - DO NOT MODIFY", "# Generated code - DO NOT MODIFY" + System.getProperty("line.separator") + "BalancerMember " + node + " route=" + instanceID) | |
| proxyConfigFile.text = modifiedConfig | |
| ServiceUtils.killProcess(context.externalProcessId) | |
| }, | |
| "remove-node" : { node, instanceID -> |