To use VMware's all-in-one ServerTemplate to launch a server in the cloud with VMware's open source Cloud Foundry PaaS technology stack.
Table of Contents
You will need to create an A Record for the all-in-one Server. Select one of the supported DNS Providers (e.g. DNSMadeEasy, DynDNS, Route 53) and create the following A Record.
After you create the A Record, you will need to write down the Dynamic DNS identifier that was assigned to your A Record. Click the DDNS ID link and write down the Record ID Number. (e.g. 1234123) You will need to provide this value later on in the tutorial where you provide values for missing inputs.
If you do not have a GitHub account, you will need to create one so that you can download the Cloud Foundry public repository and submodules.
In order to launch an EC2 Server, you will the following cloud resources. If these resources are not available, you will need to create them.
For AWS, you will need an EC2 SSH Key and EC2 Security Group with the following port permissions. Note: You will only be able to launch a Server in the AWS region (e.g. AWS US-East) in which these resources exist.
Create a new Deployment. Later, you will add the all-in-one Server into this Deployment. See Create a New Deployment.
Go to Design -> MultiCloud Marketplace -> ServerTemplates. Use the search tool to find and import the most recent revision of the "Cloud Foundry All-In-One (Alpha)" ServerTemplate. A copy of the ServerTemplate will be saved in your RightScale account's local collection. (Design -> ServerTemplates)
When viewing the imported ServerTemplate, click the Add to Deployment button.
Select the AWS region (e.g. AWS US-East) into which you will launch the Server. Note: You must select the same region as the required cloud resources. Fortunately, you can use the default values for most of the fields. However, you will need to make appropriate selections for the following fields:
Note: AWS 't1.micro' EC2 instance types are not supported due to the memory requirements of the stack.
For more information, see Add a Server to a Deployment.
As a best practice you should define inputs that you want to be inherited by all Servers in the Deployment at the Deployment level. There's only a couple of inputs that you'll want to purposely leave blank because you're going to define at the Server level since they are Server-specific.
Click on the Deployment's Inputs tab. Click Edit and provide values for the following missing Inputs.
|Input Name ||Input Type ||Description |
|CC_ADMIN_EMAIL||Text||Provide the name of the admin or other users that will be set up in the cloud controller. (e.g. firstname.lastname@example.org email@example.com)|
|DNS_PASSWORD||Text/Cred||Provide the login password to access your DNS Records with your DNS Provider. (e.g. mypassword)|
|DNS_PROVIDER||Text||Select the DNS Provider that you used to create your A Record. |
|DNS_USER||Text/Cred||Provide the login username to access your DNS Records with your DNS Provider. (e.g. username)|
|LOCAL_REGISTER_ONLY||Text||Would you like only users connected to the Cloud Controller to be allowed to register? (e.g. true)|
|MYSQL_ROOT_PASSWORD||Text||Sets to root password for MySQL. (e.g. root)|
|PRIVATE_SSH_KEY||Cred||Select the Credential that you created earlier for your GitHub account's private SSH Key. (e.g. GITHUB_PRIVATE_SSH_KEY)|
Note: Leave the CC_SUBDOMAIN and EXTERNAL_DNS_ID inputs undefined.
You are now ready to launch the Server. Go to the Deployment's Servers tab and click the Launch action icon next to the all-in-one Server.
An input confirmation screen will appear and show you all of the inputs that will be used to launch the Server. There should be only two missing inputs since you defined most of them at the Deployment level. Define values for the following missing inputs.
Since you want to save these settings at the Server level so that future launches of the Server will also use these values, click the Save and Launch. If you just clicked the Launch button, the values that you provided will not be saved for future launches of this Server. If you clicked the Save and Launch button, you should see these inputs defined under the "Next" Server's Inputs tab.
|Input Name ||Input Type ||Description |
|CC_SUBDOMAIN||Text||Enter the name of the url of the subdomain that you created with your DNS Provider. (e.g. cf.example.com) Note: Do not include the asterisk (*).|
|EXTERNAL_DNS_ID||Text||Enter the DDNS ID that was assigned to the DNS A Record. (e.g. 1234123)|
In a few minutes the Server will become operational.
Registration is only limited to users connected to the server when LOCAL_REGISTER_ONLY input is true
SSH into the server and run these commands to install the vmc gem, target localhost and register a user
gem install vmc --source http://gemcutter.org vmc target localhost:9022 vmc register --email firstname.lastname@example.org --passwd changeme
If 'email@example.com' is defined in the CC_ADMIN_EMAIL input, it will have admin privileges. Admin users can add/delete users using the vmc command from remote systems also.
Launch a server/desktop and install the vmc gem client software. Login into the machine and run the following command:
gem install vmc --source http://gemcutter.org
Login into the instance and run the following commands:
vmc target api.cf.example.com
vmc login --email firstname.lastname@example.org --passwd changeme
View the currently installed applications
wget https://rs-supportal.s3.amazonaws.com/unified_app_sinatra.zip unzip unified_app_sinatra.zip cd unified_app_sinatra
In this example, we're allocating 256MB of memory to the application. In this example, the name of the application is rs.
vmc push myapp --mem 256M --path . Application Deployed URL: 'myapp.cf.example.com'? Detected a Sinatra Application, is this correct? [Yn]: y Creating Application: OK Would you like to bind any services to 'rs'? [yN]: y The following system services are available:: 1. mongodb 2. mysql 3. redis Please select one you wish to provision: 2 Specify the name of the service [mysql-f99f]: mysql-myapp ... Starting Application: OK
Check to see if the application was loaded onto the Server. List all current applications.
vmc apps +-------------+----+---------+----------------------------+-------------+ | Application | # | Health | URLS | Services | +-------------+----+---------+----------------------------+-------------+ | myapp | 1 | RUNNING | myapp.cf.example.com | mysql-myapp | +-------------+----+---------+----------------------------+-------------+ vmc stats myapp +----------+-------------+----------------+--------------+--------------+ | Instance | CPU (Cores) | Memory (limit) | Disk (limit) | Uptime | +----------+-------------+----------------+--------------+--------------+ | 0 | 0.4% (2) | 19.8M (256M) | 9.4M (2G) | 0d:0h:1m:41s | +----------+-------------+----------------+--------------+--------------+
sed -i -e 's/succeeded/SUCCEEDED/' public/index.html vmc update myapp Uploading Application: Checking for available resources: OK Processing resources: OK Packing application: OK Uploading (4K): OK Push Status: OK Stopping Application: OK Staging Application: OK Starting Application: OK
Requires admin privileges
vmc add-user --email email@example.com --passwd example Creating New User: OK vmc delete-user firstname.lastname@example.org Deleting User: OK
vmc delete myapp Provisioned service [mysql-myapp] detected, would you like to delete it? [yN]: y Deleting application [myapp]: OK Deleting service [mysql-myapp]: OK vmc logout Successfully logged out of [http://api.cf.example.com]
vmc help vmc help crashlogs Usage: vmc crashlogs <appname>
© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.