BLOG

Category: 'vmc'


Richard Seroter

Micro Iron Foundry Image Updated and Ready for Use

Micro Iron Foundry is a VM image that makes it easy to add the .NET DEA to Micro Cloud Foundry development environments. This powerful combination helps developers design their Cloud Foundry solutions locally before pushing to any number of public hosting providers.

Read More
Iron Foundry

IronFoundry.ME Environment Now Running Latest Iron Foundry Bits

Last weekend, we did a refresh of the sandbox IronFoundry.ME environment to make sure that it was running the latest Iron Foundry bits. As part of that update, we've enabled and upgraded a few interesting things.

Read More
Iron Foundry

Managing PostgreSQL and MySQL Application Instances in Iron Foundry

One reasonable concern with PaaS platforms is whether or not developers can easily access and administer backend application services. Iron Foundry database services such as PostgreSQL and MySQL have very strong management tools that you don't want to abandon when working with a PaaS instance. In this post, we'll look at how to wire up existing database management tools to PostgreSQL and MySQL.

PostgreSQL

PostgreSQL (discussed in this previous Iron Foundry blog post), is a very popular open source database. Developers or database administrators typically use the pgAdmin tool to author and debug queries, perform database backups/restorations, reindex and cleanup (VACUUM) data,  manage server jobs, and much more. You can download the pgAdmin tool directly, or find it included in the PostgreSQL package itself. For this demonstration, I installed PostgreSQL locally and got the pgAdmin tool along with it. After installing the database software, I opened a command prompt on my Windows machine and targeted my Iron Foundry environment. After authenticating myself, I issued a vmc command ("vmc services") to see which application services were available, and which services I had already provisioned. So far, no application services were provisioned. Let's change that. I created a new PostgreSQL instance by issuing the vmc command vmc create-service postgresql. Note that I didn't need to bind it to an application and can simply create a standalone instance that could be used by many Iron Foundry web applications. Now there was a running instance of PostgreSQL in my environment. At this stage, there was no way for the pgAdmin tool to access this instance. However, thanks to the Cloud Foundry Caldecott technology, I could create a secure tunnel for pgAdmin. The vmc tunnel command opens up a port that pgAdmin can use to administer that database server. I could have chosen to use the psql client which would have let me issue commands right here in the command prompt, but since I wanted to use the full-featured pgAdmin tool, I selected the "none" client. Notice that I got four key pieces of information back: username, password, name and port. Together, these data points will get us logged into our environment. I opened the pgAdmin tool and could see that the only server currently recognized was the one on my local machine. I clicked the "Add a connection to a server" and was shown the "New Server Registration" prompt. For the "Name" value, I used the "name" that came back from the tunnel command; for "Host" value I set it to "localhost"; for the "Port" I used "10000"; and for the Username and Password, I used the corresponding values returned by the tunnel command. Once connected, I could navigate all the database artifacts and browse the standard options for backing up data, querying tables, and creating new tables. The pgAdmin tool is a very handy and useful way to manage your database artifacts and Iron Foundry makes it easy to use this tool against your application services.

MySQL

MySQL is also a very popular open source database and we want to make sure that database developers and administrators can use familiar tooling even if their application instance sits in a PaaS like Iron Foundry. The MySQL team has made significant investments in their Workbench tool, and here we'll see exactly how you hook the Workbench up to an Iron Foundry instance. First, I downloaded the standalone Workbench tool. Then, I added a new MySQL instance to my Iron Foundry environment by using the vmc create-service mysql command. Like the PostgreSQL example prior, I created a tunnel so that the MySQL Workbench tool could "see" our Iron Foundry instance. As before, I also chose the "none" client so that I could connect the GUI tool instead of issuing command statements only. Notice that I got back database credentials ("username"/"password"), a schema instance name ("name"), and a port number. I was now ready to connect the MySQL Workbench to my database instance. The Workbench has three core functions: SQL development, data modeling, and server administration. In this example, I created a new pair of tables, and deployed them to the database instance in Iron Foundry. In the Workbench, I clicked the "Create New EER Model" in order to generate a data model. The first thing that I did was right-click the schema name and choose "Edit Schema." On the subsequent window, I changed the default "mydb" name to the the "name" value returned by the vmc tunnel command. I then chose to add a new diagram to the model and proceeded to create a pair of new tables, "customer" and "order", and defined a relationship between them. With the model complete, I chose the "Forward Engineer" option so that this model could be used to generate the actual tables. I was then prompted to create an actual connection to the target database, and this is where the tunnel-provided values came into play. I plugged in the username and password, and set the Hostname value to "localhost" and the Default Schema to the tunnel-provided "name" value. I then kept the remaining default options, including the selection of the two tables to forward engineer, and reviewed the pending SQL Script to be executed. After successfully completing the wizard, I could open an instance of the SQL Editor and browse my schema. Sure enough my two tables, relationship included, were there.

Summary

While one of the key benefits of a PaaS is managed services, it's important to have the option to administer these application services using the powerful,  familiar management tools currently available to users. Both PostgreSQL and MySQL have solid management interfaces and we saw here how you can tunnel into these Iron Foundry database instances  and perform standard operations against your service.

Read More
Iron Foundry

Iron Foundry Adds Microsoft Service Bus as a New Application Service

Microsoft recently released a beta version of their Service Bus for Windows messaging technology, and the Iron Foundry team has now added this as an available service in Iron Foundry. The Service Bus for Windows is a scaled down version of the Service Bus product included in their Windows Azure cloud offering. The Service Bus for Windows, which supports brokered message through both traditional Queues and multi-subscriber Topics, provides Iron Foundry developers yet another option when building distributed applications. Our awesome dev team followed the standard steps for adding new application services to a Cloud Foundry / Iron Foundry environment and also used a previous write-up of mine to guide the software installation. We’ve already updated the vcap-services source code into Github and you can clone the mssb (Microsoft Service Bus) directory today. There were also changes to the .NET DEA to account for this new service and handing credentials back to the user. The Service Bus for Windows uses Microsoft SQL Server for its persistence tier, so we’ve tied the service to the instance of SQL Server that runs in Iron Foundry. Our hosted ironFoundry.me environment is running this today, and we’ve provisioned a shared Service Bus farm and host that holds each consumer’s individual namespace. Let’s see a demonstration of this in action! To make life easier, we’ve built a sample web application that interacts with Service Bus Queues. We’ll start by looking at that application, and then deploy the application to Iron Foundry. The application contains a few ASP.NET Web Forms and a helper class. The helper class (QueueManager.cs)  contains a singleton that upon startup, parses Iron Foundry-provided URLs and credentials encoded as JSON in the application’s web.config file and uses those parameters to instantiate the core objects in the Windows Service Bus SDK. Then we have some static operations for both sending to and receiving from the Service Bus Queue. These operations are used in the pair of core ASP.NET pages to send and receive messages. Let’s now deploy this application to Iron Foundry and see how it works. Using vmc, I targeted the api.ironfoundry.me environment. I can confirm that the Service Bus for Windows is an available service by issuing a vmc services command. Great. Now let’s push this web application and provision an instance of this new service type. After publishing the ASP.NET web application to a file directory, I issued the vmc push command to start the deployment process. At this stage, I’m asked if I want to create a new service instance to bind to, or if I had already provisioned one, which instance I’d like to associate with. In this case, I have no existing services, so I’ll choose to create a new service. Within a matter of moments, my application is deployed and a new service instance is provisioned in the shared environment. This environment is not currently part of a Windows domain, so during service provisioning, a new local user is created and assigned to the developer’s own Service Bus namespace. All the URLs and credentials for the application are injected into the application’s web.config file. We can see this through vmc by viewing the file with the vmc files app/web.config command. These JSON-encoded values are then read by our application and used when authenticating the caller during Queue operations. Upon visiting the URL of the Iron Foundry application, we can see the option to send a message to a Queue. When we submit the message, it is added to a Queue, which means that it is persisted in a database. I then switch over to the “Receive” web form and choose to pull all of the messages from the Queue. The Service Bus for Windows is still in Beta, but we thought it would be fun to add this as an Iron Foundry service. You can download the source code for this sample application from here. Messaging is a core part of many modern web applications and the Service Bus for Windows gives Iron Foundry developers another way to link systems together. Shout it

Read More
Iron Foundry

Sync with Cloud Foundry

On the Iron Foundry Project we are diligent about keeping up to date with any significant Cloud Foundry changes. With the recent refactoring the Cloud Foundry team has been working there has been a lot more to keep track of. For information on the Cloud Foundry side of things check out these write ups by Mark Lucovsky (Cloud Foundry Roadmap: Below the Water Line, Refactoring the VCAP Repo, and Heads Up on Some New Cloud Controller Features). To check out the changes, with appropriate Iron Foundry extensions, check out the Iron Foundry Repositories. If you'd like to try out your own custom deployment, the scripts have been updated accordingly also. VMC CLI One of the key things we've done in the last few weeks is change the vmc (usage information) from preview release to a full release. So to get the latest Iron Foundry enabled vmc be sure to uninstall the previous version: Then simply use gems to install the latest (KB Article Available): If ruby and gems isn't installed on Windows yet follow these quick steps. Install Ruby for Windows from Ruby Installer. This is tested using version 1.9.3. During installation you can either add ruby to your PATH or add it manually later. Run the following commands from a command prompt. You should ensure that ruby and sqlcmd are in your PATH as well. Checking ruby version & installing on Windows:

Read More
Iron Foundry

Caldecott with MS SQL Server!

Yesterday we launched our new testing environment that you can read about. With that announcement we added support for Caldecott which allows you to tunnel from your environment to services in the Cloud Foundry environment. Today we have enabled MS SQL support with Caldecott into our .ME environment and also our own version of the Cloud Foundry VMC that has all of the Iron Foundry support built in. Install VMC Iron Foundry Install Ruby for Windows from Ruby Installer. This is tested using version 1.9.3. During installation you can either add ruby to your PATH or add it manually later. Run the following commands from a command prompt. You should ensure that ruby and sqlcmd are in your PATH as well. Checking ruby version:

C:\>ruby --version
ruby 1.9.3p125 (2012-02-16) [i386-mingw32]
C:\>gem install vmc-ironfoundry --pre
Caldecott and MS SQL To use Caldecott on Iron Foundry from a Windows machine to connect to a provisioned MS SQL database, follow these steps. Install Ruby for Windows from Ruby Installer. This is tested using version 1.9.3. During installation you can either add ruby to your PATH or add it manually later. Run the following commands from a command prompt. You should ensure that ruby and sqlcmd are in your PATH as well. Checking ruby version:
C:\>ruby --version
ruby 1.9.3p125 (2012-02-16) [i386-mingw32]
Ensuring that sqlcmd.exe is in your PATH. If not, it is located by default at C:\Program Files\Microsoft SQL Server\100\Tools\Binn\sqlcmd.exe
C:\>sqlcmd /?
Microsoft (R) SQL Server Command Line Tool
Version 10.50.2500.0 NT x64
Copyright (c) Microsoft Corporation. All rights reserved.
Install the vmc-IronFoundry gem
C:\>gem install vmc-IronFoundry --pre
Fetching: vmc-IronFoundry-0.3.16.IF.1.gem (100%)
Successfully installed vmc-IronFoundry-0.3.16.IF.1
1 gem installed
Installing ri documentation for vmc-IronFoundry-0.3.16.IF.1...
Installing RDoc documentation for vmc-IronFoundry-0.3.16.IF.1...
Target api.ironfoundry.me and log in to your account
C:\>vmc target api.ironfoundry.me
Successfully targeted to [http://api.ironfoundry.me]
C:\>vmc login --email  --passwd XXXYYYZZZ
Attempting login to [http://api.ironfoundry.me]
Successfully logged into [http://api.ironfoundry.me]
Provision an MS SQL database
C:\>vmc create-service mssql
Creating Service [mssql-c902d]: OK
Tunnel to your database
C:\>vmc tunnel mssql-c902d sqlcmd
Deploying tunnel application 'caldecott'.
Uploading Application:
 Checking for available resources: OK
 Packing application: OK
 Uploading (1K): OK
Push Status: OK
Binding Service [mssql-c902d]: OK
Staging Application 'caldecott': OK
Starting Application 'caldecott': OK
Getting tunnel connection info: OK
Service connection info:
 username : uxeBbNM0jYAFS
 password : psOmxGWibimeX
 name : d7dedaf7e01ae42568c07c44ec30bff99
Starting tunnel to mssql-c902d on port 10000.
Launching 'sqlcmd -S localhost,10000 -U uxeBbNM0jYAFS -P psOmxGWibimeX -d d7dedaf7e01ae42568c07c44ec30bff99'
1>
You can now run commands from within sqlcmd against your database!
1> select @@VERSION
2> GO
Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64)
 Jun 17 2011 00:54:03
 Copyright (c) Microsoft Corporation
 Enterprise Edition (64-bit) on Windows NT 6.1  (Build 7601: Service Pack 1) (Hypervisor)
In addition, you can use the displayed connection information to connect via SQL Management Studio. Just use localhost,10000 as the "Server name". Be sure to start the tunnel first and keep it open during the time you're using Management Studio. Quitting sqlcmd will close the tunnel. connect_local.png

Read More