Skip to content

Commit

Permalink
Adding RHCLS ScalableInfra demo
Browse files Browse the repository at this point in the history
  • Loading branch information
bthurber committed May 24, 2017
1 parent 1659750 commit 63e2b0b
Show file tree
Hide file tree
Showing 64 changed files with 4,479 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ansible/configs/RHCLS-ScalableInfra-demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# RHCLS_ScalableInfrastructure

This is a set of playbooks that can be used for deploying Red Hat Cloud Suite's Scalable Infrastructure demonstration. The Scalable Infrastructure demonstration.

=== Overview
This is demonstration of how Red Hat is delivering scalable infrastructure with the capabilities that enterprises demand. Red Hat OpenStack Platform delivers scale-out private cloud capabilities with a stable lifecycle and large ecosystem of supported hardware platforms. Many organizations are building their next generation cloud infrastructures on OpenStack because it provides an asynchronous architecture and is API centric allowing for greater scale and greater efficiency in platform management. OpenStack does not, however, provide functionality such as chargeback, reporting, and policy driven automation for tenant workloads and those projects that aspire to do so are generally focused solely on OpenStack. This is not realistic in an increasingly hybrid world – and enterprises that are serious about OpenStack need these capabilities. By using Red Hat CloudForms together with Red Hat OpenStack Platform it’s possible to provide capabilities such as reporting, chargeback, and auditing of tenant workloads across a geographically diverse deployment. In the demo we demonstrate how chargeback across a multi-site OpenStack deployment works.

=== Structure
* ./env holds playbooks for creating environments. For example, creating a blueprint in Ravello or heatstack on OpenStack.
* ./cfg holds playbooks for configuring the demonstration on the created environments.
159 changes: 159 additions & 0 deletions ansible/configs/RHCLS-ScalableInfra-demo/bastion

Large diffs are not rendered by default.

164 changes: 164 additions & 0 deletions ansible/configs/RHCLS-ScalableInfra-demo/examples/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
These are sample scripts showing how to use Ravello Python SDK to connect and Ravello environment. The scripts require Python and Ravello Python SDK to be installed.

All scripts accept -u <username> parameter and prompt for password. If you want to run scripts in a batch mode you can use set-creds script to store user credentials in an encrypted file. Set-creds script prompts to enter user credentials and, encrypts user password and stores user credentials in .ravello_login file in the user home directory. After that you can run scripts without specifying user credentials. If you want to run a script and connect to Ravello with a user different from the one that is stores in .ravello_login file use -u <username> option.

To get help and usage information run scripts with "-h" option.

Scripts that manage/create applications, VMs, ephemeral tokens write to ravello.log log file created in the working directory.

Here is a list of scripts and usage examples:


app-create - creates a new application from blueprint
Example:
app-create -b "Openstack-bp" -n "my app1" -p -c Amazon -r Virginia
Creates an application "my app1" from blueprint "Openstack-bp" and publishes the application (if -p flag is used) on Amazon/Virginia Cloud. The application won't be started automatically unless you add "-s yes" flag.

app-create -b "Openstack-bp" -n "my app2" -p -s yes -t 60
Creates an application "my app1" from blueprint "Openstack-bp", publishes the application using the default COST_OPTIMIZED cloud and starts it setting expiration time to 60 minutes.

app-create -b "Openstack-bp" -n "my app3"
Creates an application "my app1" from blueprint "Openstack-bp" but does not publish it.


etoken-create - creates ephemeral access token and sets permissions

Examples:
etoken-create -n bench -d "Ephemeral token to grant access to my app" "Access token1" -p READ UPDATE EXECUTE
Creates an ephemeral access token "Access token1" with description specified by -d parameter and sets permissions to READ, UPDATE and EXECUTE

etoken-create -n bench -d "Ephemeral token to grant access to my app" "Access token2" -t 120
Creates an ephemeral access token "Access token2" and sets token expiration time to 120 minutes. Token permissions by default are set to READ, EXECUTE unless they are explicitly specified by -p <permissions> flag.



app-get-all - returns information about all applications in the user account in format: Application name, ID, creation date, owner, if-published, Cloud

Example:
app-get-all
Returns information about all applications in the above format

app-get-all -u <username>
Returns information about all applications in the Ravello user account specified by -u <username> option. When -u option is used the script prompts to enter password.


app-get-data - returns the application data

Example:
app-get-data "My app1"

Here is an example of the output showing the application summary:
name: My App1
id: 67207922
owner: John Kave
publishOptimization: PERFORMANCE_OPTIMIZED
cloud: Amazon
regionName: Virginia
totalActiveVms: 0
totalStoppedVms: 3
totalErrorVms: 0

app-get-data -i 67207922
Similar to the above it prints application summary, but as a parameter it accepts application ID instead of application name.

app-get-data "My app1" -o app1.txt
In addition to application summary it stores the application JSON file info app1.txt file including the application properties, list of VMs, the application network, and so on.

app-get-data "My app1" -a
Prints application JSON file to the standard output


app-get-state - returns the application state. Application states are STARTED, STARTING, STOPPED, STOPPING, et

Example:
app-get-state "My App1"
Returns the application state of "My App1"

app-get-state -i 67207922
Returns the application state of an application with ID 67207922


app-start - starts the application and sets the expiration time. The script checks the state of the application prior to starting it. If the application is already in a transition state (STARTING|STOPPING) or in an ERROR state the script cancels the command.

Example:
app-start "My app1"
Starts "My app1" application and sets the expiration time to 2 hours (default)

app-start "My app1" -e 60
Starts "My app1" application and sets the expiration time to 60 min

app-start -i 67207922
Starts an application with application ID 67207922 and sets the expiration time to 2 hours (default)

app-stop - stops the application if it is in STARTED state. The script checks the state of the application prior to starting it. If the application is already in a transition state (STARTING|STOPPING) or in an ERROR state the script cancels the command.

Example:
app-stop "My app1"
Stops "My app1" application

app-stop -i 67207922
Stops an application with application ID 67207922


app-get-id - returns application ID

Example:
app-get-id "My app1"
Returns ID of the application "My App1"


app-get-vms - returns information about application VMs including VM name, ID and state

Example:
app-get-vms "My app1"
Returns VM summary information. Here is an example of the output:
Name: WebServer1 ID: 849341096919040 State: STOPPED
Name: WebServer2 ID: 1426184860598272 State: STOPPED
Name: LoadBalancer ID: 4773896427405312 State: STOPPED

app-get-vms "My app1" -o app1.txt
Returns VM summary information and prints a complete VM JSON data to app1.txt file

app-get-vms -i 67207922 -o app1.txt
Similar to the above but uses application ID instead of application name

app-update - updates the application loading data from a provided JSON file. If you need to change the application JSON file manually first use app-get-data script with -o option to dump the application JSON data into a file. Then you can modify the file and use app-update to update the application. Certain fields are not allowed to be modified manually.

Example:
app-update -f app.txt
Updates an application from the input JSON file app.txt


app-mgmt - manages application VMs. Available commands: start, stop, restart, poweroff, redeploy, repair, resetDisks.

Example:
vm-mgmt -a "MyApp1" -v "WebServer1" start
Starts VM "WebServer1 from the application MyApp1". The script checks the state of the VM prior to starting it. If the VM is already in a transition state (STARTING|STOPPING|RESTARTING) or in an ERROR state the script cancels the command. If the VM is already started, the script skips the command and exits.

vm-mgmt -a "MyApp1" -v "WebServer1" stop
Stops VM "WebServer1" from the application MyApp1". The script checks the state of the VM prior to stopping it. If the VM is already in a transition state (STARTING|STOPPING|RESTARTING) or in an ERROR state the script cancels the command. If the VM is already stopped, the script skips the command and exits.

vm-mgmt -a "MyApp1" -v "WebServer1" stop
Restarts VM "WebServer1". The script checks the state of the VM prior to restarting it. If the VM is already in a transition state (STARTING|STOPPING|RESTARTING) or in an ERROR state the script cancels the command.

vm-mgmt -n 67207922 -v "WebServer1" stop
Same as the above only using the application ID instead of the application name


bp-get-all - returns information about all blue prints in the user account in format: Blueprint name, ID, creation date, owner, description

Example:
bp-get-all
Returns list of all blueprints in the user account

app-get-all -u <username>
Returns list of all applications in Ravello user specified by -u <username> option. When -u option is used the script prompts to enter password.


app-get-billing - returns billing information of all application for a given time period

Example:
app-get-billing -m 12 -y 2015
Returns list of applications and their cost in December 2015


Loading

0 comments on commit 63e2b0b

Please sign in to comment.