In this vFabric Application Director video series, we are using a simple application to demonstrate the power of automated provisioning in the cloud. In the first video, Cloud Bursting: How to Auto-Deploy Apps Internally AND on Amazon EC2, we showed how simple it is to first deploy an app to an internal cloud, then how within a matter of minutes you can redeploy the same app to a public cloud using Amazon EC2 as an example. This works because Application Director standardizes applications into blueprints, making them portable across cloud environments.
In this post and the video below, we are going show you that not only does Application Director make it simple to move your app across clouds, but it also helps make your application more modular, allowing for you to swap out application components such as your database. In the example below, we will take the previous application blueprint and perform an iteration on it. By simply changing it’s Spring profile we will be able to swap the in-memory database the application had been using to point to vPostgres on an external node, and deploy it.
1. Start with Existing Blueprint
We start on the contact app page to see the 1.0 version of our application. We see a single node with vFabric tc Server.
2. Copy Application, Rename 1.5, and Edit Blueprint
We will copy the application, drill into the blueprint, and change from a single node to a node array or clustered node, but leave the size set to 1.
3. Add New Database Node and Add Create DB Property
In the image below, we have taken a new RedHat 64-bit node from the logical templates on the left and dragged it out into the canvas area in the middle. Then, we added a vFabric PostgreSQL server from the services on in the bottom, right panel. We are now adding a command property—it’s a string with the location to a P-SQL script. Then, we will add a property to create the database, default user, and main schema as well as the Spring Security schema. Then, we add scripts through something called actions—these configure the database.
4. Edit the Contact Web App and Point to New DB
Next, we edit the contact web app—changing it to use vPostgres. We use a property to define the JDBC connection and create a dependency between the app and database. Basically, the contact app won’t finish being deployed until the database is ready. We add a property for IP address and another property for the vFabric tc Server instance directory.
5. Modify WAR Installation Script
In the WAR installation, we are going to do a few things. Most importantly, we change the directory of the tc Server binary and the JDBC URL. Then we change the environment to have more memory and use Spring profiles. After this is done, the external database is running behind our app.
6. Deploy the New App to vCloud
We create a new deployment profile—these don’t copy over because they are associated to the application version. We select an environment (i.e. a specific cloud), the VM templates, and the logical networks. Then, we select the application properties for the node, services, and application components. We can over-ride anything at this step. For example, we could decide to deploy to EC2 with S3 as a location at this point.
7. Confirming the Flow of Install and Pressing Deploy
Here we have a contact application cluster with a size of 1. We see the tc Server and the vPostgres workflows—install, configure, start, etc. The blue dots show a dependency where the application won’t continue with it’s install and restart until the database is configured. Then, we review the details in Step 4 of the GUI and press deploy.
8. Monitoring the Process
Here we see the task details (top, left) with things like status, time, user, cloud provider. The top, right panel shows the blueprint. Then we see the VM provisioning status and resolving IPs. Once the infrastructure is ready, we see the execution plan run in the bottom right panel. Many elements can be drilled into. We also have a middle-tier that can scale out as needed.
The Video: Re-Deploying an App with a Different Database
Learning more about vFabric Application Director:
- Learn How Apps will be Deployed in the Future on services like vFabric Application Director
- Learn what “Cross Platform Cloud Application” means
- Learn about Model-Driven and Workflow-Driven Apps
- Read how VMWare IT is managing Policies with Provisioned Apps to Save Money
- Download a free trial and learn more about vFabric Application Director