2 Creating and Deploying Ravello Applications to Cloud

Learn how to create and design a new Ravello application for your VMs and deploy it to cloud.

Installing the VM Import Tool

You can import your virtual machines (VMs) or disk images either by using the Ravello Import Tool or command line interface (CLI) Import Tool. The CLI allows you to import your VMs and will give you the flexibility of automating the import process.

Download the tool from the Ravello VM Import Tool page and import your VMs using the Ravello console. You can install the VM Import Tool on a Windows, Linux, or Mac OS X host.

Alternatively, you can install the Ravello VM Import Tool from the Ravello console itself. The URL of the Ravello console is typically provided to you by your Oracle Cloud Account administrator. It is also available in the Welcome email received when you subscribed to Oracle Ravello Cloud Service. Log into the Ravello console:
  • Select the Library > Disk Images page, click + Import Disk Image. If the VM Import Tool has not yet been installed, the following web page is displayed: “Unable to connect to the Ravello VM Import Tool” with the options for downloading the tool.

  • Select the Library > VMs page, click + Import VM. If the Import Tool has not yet been installed, the following web page is displayed: “Unable to connect to the Ravello VM Import Tool” with the options for downloading the tool.

Downloading the GUI VM Import Tool

If you select Download GUI VM Import Tool, then you can import VMs from within the Ravello user interface.
Install the tool according to the Operating System (OS) you selected:
  • For a Windows operating system, follow the on-screen instructions to download and install the utility.

  • For a Mac operating system, double-click the ravello_mac.dmg file and drag it into the installation folder.

  • For a Linux operating system, download and extract the ravello_linux.tar.gz installation file. This will automatically creates the Ravello folder in your system. Run the Ravello\installer.sh file to install the utility. If any dependency file is missing, follow the on-screen instructions to install the missing files.

Downloading the CLI VM Import Tool on a Windows Host

The CLI method allows you to import your VMs offline and will give the flexibility of automating the import process. If you select Download CLI VM Import Tool, then extract the file provided and use the CLI method to import your VMs.
  1. Select Download CLI VM Import Tool and download the zip file.

  2. Extract the zip file from the downloaded location and run the executable file.

    Note:

    If a problem occurs, follow the instructions contained in the README file to install the CLI using a python script.

Locating and Verifying the VM Import Tool Installation

All the installation files are saved under C:\Program Files (x86)\Ravello Systems. When you download the Ravello VM Import Tool, an icon will appear on the taskbar to notify you that the task is running. If it is not running, then on the Windows machine, run the executable file from C:\Program Files (x86)\Ravello Systems\Ravello import utility\ravello_vm_import_server.exe.

Downloading the CLI VM Import Tool on a Linux or Mac OS X Host

The CLI method allows you to import your VMs offline and will give the flexibility of automating the import process. If you select Download CLI VM Import Tool, then extract the file provided and use the CLI method to import your VMs.
  1. Select Download CLI VM Import Tool and download the zip file.

  2. Extract the zip file from the downloaded location.

  3. Run the command ./install.sh.

Adding Proxy Settings for Image Uploads

If you are working in an environment where a proxy is needed to access the internet, you need to manually configure the proxy settings before you can use the import tool.

To add the proxy settings:
  1. In the C:\Program Files (x86)\Ravello Systems\VM import utility directory, add a config.properties file that contains these lines:
    	[upload] 
    	proxy_address = <ip address of proxy server>
    	proxy_port = <port on which the proxy server accepts connections>
    If your proxy is using basic authentication, then add user and password to the same configuration file:
    			[upload] 
    			proxy_address = <ip address of proxy server>
    			proxy_port = <port on which the proxy server accepts connections>
    			proxy_username = <proxy user>
    			proxy_password =  <proxy password>
  2. Save the config.properties file.
    • For Windows OS:C:\Users\user\.ravello

    • For Linux OS: /home/user/.ravello/

  3. Restart the Ravello Import Tool.
    • If you are using Windows OS:
      1. Go to Windows Task Manager > Applications and select RavelloImageImportServer.

      2. Click End Task.

      3. Restart the tool by navigating to Start > All Programs > Ravello Import Utility > Import Tool.

    • If you are using Linux OS, kill the ravello-vm-upload process and restart the utility.

Identifying and Importing the VMs and Disk Images That Make Up Your Application

You can use a set of predefined VMs or disk images, or you can import VMs to create your application.

You can import VMs or disk images as a separate action or you can import them while creating an application instance. Imported VMs are managed on the Library > VMs page and are used to create application instances. For disk images, go to Library > Disk Images.

Note:

Before you import your VM or disk images, download and install the VM Import tool. See Installing the VM Import Tool.

Extracting and Uploading VMs from vCenter, vSphere, or ESX Server

If your virtual machine is running on a vCenter, vSphere or ESX, then it is recommended that you extract it directly from those servers.

To extract and upload VMs from vCenter, vSphere, or an ESX server:

  1. Stop the VMs before extracting them.
  2. You will need the location of your vCenter, vSphere, or ESX server and your login credentials. After you use the VM Import Tool to connect to the vCenter, vSphere, or ESX server, you can then select VMs so they can be uploaded into your Ravello account. This process has no effect on the source VM.
  3. Log in to the Ravello console and navigate to Library > Disk Images and click +Import Disk Image.
    When prompted, enter the password you use to log on to Ravello. You will see the VMs that are already imported and their status in the Ravello VM Import Tool page. You can upload more VMs if needed.
  4. Select Extract and upload VMs from vCenter, vSphere or ESX (recommended) and click Next.
  5. Enter the vCenter or an ESX IP address or host name, and the necessary login credentials, and then click Next.

    Note:

    The top level of the hierarchy displayed varies according to whether you connect to a vCenter or a an ESX server.
  6. On the Select a VM page, drill down to locate and select the VM to extract.
  7. (Optional) If you prefer to extract the VM now but upload it later, select Export only and click Choose folder to specify the location where you want to save the extracted VM.

    Note:

    You can upload the VM later by selecting Upload a VM from OVF file or Ravello Export file in the Ravello VM Import Tool.
  8. Click Upload.
    The VM is added in the VM Import Tool page. The progress of the upload process is indicated for each VM.

    Note:

    If you experience slow access to vCenter VMs, usually it is due to connectivity to vCenter. It is recommended to run the tool on the same network or move only the python server.

Uploading a VM from a File

You can upload a VM from an Open Virtualization Format (OVF), Open Virtual Appliance (OVA), or Ravello export file.

To upload a VM from a file:
  1. Log in to the Ravello console and navigate to Library > VMs and click +Import VM.
    When prompted, enter the password you use to log on to Ravello. You will see the VMs that are already imported and their status in the Ravello VM Import Tool page. You can upload more VMs if needed.
  2. Select Upload a VM from an OVF, OVA, or Ravello Export file and click Next.
  3. Select the file to upload and click Upload.
    The VM is added in the VM Import Tool page. The progress of the upload process is indicated for each VM.

Creating a VM by Uploading Existing Disk Files

You can upload your existing disk files that are in VMDK and QCOW formats and create a VM. A new VM is added to the library containing the disk images that are selected to be imported.

To create a VM by uploading disk files:
  1. Log in to the Ravello console and navigate to Library > Disk Images and click +Import Disk Image.
    When prompted, enter the password you use to log on to Ravello. You will see the VMs that are already imported and their status in the Ravello VM Import Tool page. You can upload more VMs if needed.
  2. Select Create a new VM by uploading existing data files and click Next.
  3. Locate the file and upload.
  4. In the VM name field, assign a name to the new VM.
  5. Click Upload.
    The VM is added in the VM Import Tool page. The progress of the upload process is indicated for each VM.

Uploading a Single Disk Image

You can upload a single disk image in ISO, VMDK, or QCOW format.

To upload a disk image:
  1. Log in to the Ravello console and navigate to Library > Disk Images and click +Import Disk Image.
    When prompted, enter the password you use to log on to Ravello. You will see the VMs that are already imported and their status in the Ravello VM Import Tool page. You can upload more VMs if needed.
  2. Select Upload a Single Disk Image and click Next.
  3. Select the type of file (OVF or Ravello Export File) and upload.
    The VM is added in the VM Import Tool page. The progress of the upload process is indicated for each VM.
  4. When prompted, enter the password you use to log on to Ravello.
  5. In the Browse for VM template file dialog box, select the virtual image machine data file (.vmx), and then click OK.

Importing VMs Using CLI

Another way to upload your VMs into Ravello are by using the Command Line Interface (CLI).

Make sure that you have installed the CLI VM Uploader before proceeding. If you have not installed the VM Uploader, go to Ravello VM Import Tool.
To upload VMs using CLI:
  1. Open CLI and type ravello upload -- disk_file = path to the VM image -u user@ravello.com --namename of the VM
  2. When prompted, enter your password.
  3. When the summary appears, verify the information that it contains, and type Yes. The upload is initialized.

Verifying Imported VMs

Imported VMs are automatically added to the Ravello VM Library with an initial status of Pending verification. An imported VM or disk image cannot be used in an application before its configuration is verified.

To verify imported VMs:
  1. Select the VM or disk image on the Library > VMs or (Disk Images) page.
    The VM properties are displayed in a series of tabs in the Details pane.
  2. Review the VM properties in each of the tabs and click Save. The status of the VM in the Library changes from Pending verification to Ready.

Uploading and Using an ISO Image

You can upload an ISO file using the GUI or CLI Ravello Import tool and then use the ISO image to set it up as a CD-ROM image.

Upload your ISO file using the Ravello Import Tool. See Identifying and Importing the VMs and Disk Images That Make Up Your Application.
To use an ISO file as a CD-ROM:
  1. Log in to the Ravello console and on the Ravello Applications page, click New Application. You are then prompted to provide application details such as name and description.
  2. On the application canvas, drag any VM onto the workspace.
  3. On the right hand side, select Disks in the Details pane.
  4. Click + Add new and select Add CD-ROM.
    A blank entry is added to the Disks list. You can use that disk to install the VM using the uploaded ISO image.
  5. Select cdrom and click Edit.
  6. Click Browse to locate the images that you have uploaded to Disks library..
    The Disk Images page is displayed.
  7. Select the previously uploaded ISO image and save.
    Your ISO image appears in cdrom and enables you to create a VM from the ISO image.

Creating a Ravello Application

You can create a new application instance based on your imported VMs or use an existing blueprint to modify your application.

Note:

If you are creating this application based on a blueprint, then select From Blueprint in the Applications page and choose a blueprint from the drop-down list. If you select Create Application from the Library > Blueprints design workspace, then the blueprint is selected for you by default.

If you are creating an application based on a public VM, then select an existing key pair from the Key Pair drop-down list or click to add a new key pair. For details on generating and importing key pairs, see Working With Key Pairs.
To create an application:
  1. Navigate to Applications > Create Application.
  2. Enter a name and description for the application.
    The application instance canvas opens in a new tab automatically.
  3. All your imported VMs will be listed in the left pane, you can also find them in Library. In the Canvas tab, drag an image name from the VM Library onto the workspace. If you want it to be part of a group, drag it directly onto the group object. The group object outline turns blue when selected.
    When you drag and drop a VM on the workspace, its details appear at the right hand side on the details pane, where you can edit the image properties for the current design. The source image that was saved in the library will not be modified.
  4. Check your network in the Network tab.
    Ravello automatically compiles a private encapsulated network for this application. When you uploaded those VMs, meta data will be parsed to extract the networking information and then a network is constructed to fit the needs of this application. So Application will have the network exactly the same way as your data center. If anything needs to be changed, see Designing or Editing a Ravello Application (Optional).
  5. Optionally, you can move applications into a cost monitoring bucket and track the costs that are generated by all the applications in that bucket. Refer to Creating a New Cost Monitoring Bucket.

    Note:

    If you have not created a cost monitoring bucket, you can skip this step. You can always move the applications to cost monitoring bucket at a later time.

Working With Key Pairs

When working with generic or public VM templates, you can connect to VMs using predefined Secure Shell (SSH) key pairs. The use of SSH gives you the option of connecting to public VMs using key pairs instead of a user name and password. Each key pair contains a public and a private key and can be generated or imported into Ravello. The public key that is generated will be saved in Ravello, while the private key must be saved on your machine.

Key pairs are managed on the Library > Key Pairs page, however, you can also add or import key pairs while creating a new application that is based on a public blueprint. Similarly, you can access key pair functionality from the General tab of the Details pane when a public VM is selected on the canvas (for applications or blueprints).

Note:

The Key Pairs login is available only for VMs that support Cloud-init.
Generating or Importing Key Pairs

The key pairs generated by Ravello are compatible with Linux and Mac platforms. If you are using a Windows machine to connect to a Linux guest VM, use PuTTY or any other similar client to connect using SSH.

To generate a key pair:
  1. Navigate to Library > Key Pairs and click Create Key Pair.
    The Key Pairs dialog box is displayed.
  2. If you are creating applications using the public disk images or blueprints that are found in the library, then generate or import a key pair to SSH into the VM. Select your option for the key pair assignment:
    • Generate Key Pair — When you generate a key pair, the private key is downloaded as a .pem file, which can be saved on your system. The public key is saved in the VM.
    • Import a Public Key — Use this option when you want to associate with your public key that is stored on any of your servers. Note that when you import a key pair, only the public key is saved and used when the VM starts.
    Generated and imported key pairs are listed in the Library > Key Pairs list.

    Note:

    Once you publish the VM, you cannot change the key pairs.
Connecting to a Linux or Mac Instance Using SSH Key Pairs

If you’ve created your instance using one of the publicly shared disk images or blueprints from Oracle Cloud Infrastructure Ravello Service, then you can use SSH to access your Linux or Mac instance.

  • Generate an SSH key pair before connecting to a Linux or Mac instance. See Generating or Importing Key Pairs.

  • Create an external supplied service on the VM, with port 22 open. See Adding and Connecting Service Interfaces.

  • Ensure that the SSH private key corresponding to the public key that you associated with your instance while creating it is available on the host from which you want to SSH to the instance.

  • Ensure that the instance has a public IP address.

  • Make sure that you have enabled the SSH access option on the VM before using SSH.

To SSH into a Linux or Mac VM:
  1. Open an SSH client
  2. Locate your private key file (for example, ravelloDevKey.pem). The wizard automatically detects the key you used to launch the instance.
  3. To verify that the key permissions of the private key correct, run this command: chmod 400 <private key filename>. For example, chmod 400 ravelloDevKey.pem.
  4. Connect to your VM using the following command: ssh -i <private key filename> root@<EIPof VM>. For example, ssh -i ravelloDevKey.pem root@<EIPof VM>
Using SSH Key Pairs from a Windows Machine

You can use PuTTY or any other similar client to connect to your Linux guest VM from your Windows machine using SSH key pairs. This section assumes that you are using PuTTY to connect to your instance.

If you have the standard OpenSSH (.pem) key, then you have to convert keys from OpenSSH (.pem) to PuTTy (.ppk) format:
  1. Download a PuTTygen tool and select File > Load Private Key.

  2. Browse to open the *pem file that contains the key you want to convert.

    Note:

    By default, PuTTYGen displays only the files with extension .ppk. Select All Files from the drop-down list to view all file types.
  3. Save the Private Key. When prompted to indicate whether you want to save the key without a pass phrase, click Yes. The key is saved in the .ppk format and can be used to connect to your VM using PuTTy SSH.

Before connecting from a Windows machine, ensure that:
  • PuTTY is installed on your Windows machine. To download PuTTY, go to http://www.putty.org/.

  • instance has a public IP address.

  • SSH is enabled on the Windows machine.

After you prepare your machine:
  1. Run the PuTTY program.
    The PuTTY Configuration window is displayed, showing the Session panel.
  2. In the Host Name (or IP address) field, enter the public IP address of your instance.
  3. Confirm that the Connection type option is set to SSH.
  4. In the Category tree, expand SSH if necessary and then click Auth.
    The Auth panel is displayed.
  5. Click the Browse button next to the Private key file for authentication. Navigate and open the private key file that matches the public key that is associated with your instance.
  6. In the Category tree, click Session.
    The session panel is displayed. Save the session.
Try opening the connection. If this is the first time you are connecting to an instance, the PuTTY Security Alert window is displayed, prompting you to confirm the public key. Click Yes to continue connecting.

Designing or Editing a Ravello Application (Optional)

If you want to modify your application, for example, if you want to add another application server or configure a service, then you can edit or design your application accordingly.

Select your application in the Applications page and view, edit, or design your application instance as required. If you are publishing the application for the first time, click Publish. If you are updating an application, click Update to apply the changes to a published application.

Note:

When you update, the entire instance will not be republished. Only the relevant changes will be updated. In some cases, a published virtual machine will be rebooted as part of the process.

Adding and Connecting Service Interfaces

You can manually add the supplied and required service interfaces to the VM images to provide entry points for accessing the application functionality.

To configure the service interfaces:
  1. Select the VM instance on the Canvas or on the VMs tab, and then select the Services tab in the VM details pane.
  2. Add the necessary service interface.
    • Supplied Service — A supplied service is a meta data object that indicates that the VM is listening on a specific IP:PORT. Supplied services determines how the virtual machines are used, and which IP addresses and ports it exposes. Even if your VM is configured with any other service on a port, you must configure the Supplied service for Ravello to allow communication to your VM through the configured port.

      Note:

      Defining a supplied service is not enough, as Ravello does not configure the service on the VM. You need to make sure that there is such service running on the VM accepting this kind of communication.

      To add a supplied interface, click + Add in the Services tab. Configure the service properties as required. For example, to connect (PING) to a specific VM, you will need to allow an incoming Internet Control Message Protocol (ICMP) traffic. Create a new supplied service configured as set IP protocol 1. To allow incoming traffic from outside the Ravello application, you have to configure this service as External (selected by default). Marking a service as External means that this service is available for external communication. For example, if you create an SSH or RDP Supplied service by selecting it from the drop-down and marking it as External, you can access the VM from inside the application or from your computer that is not in the same network.

    • Required Service — This to indicate which services are being consumed by the VM. Required services are used for documentation purposes, to graphically indicate the connections between the VMs on the canvas. This setting is optional; it doesn't change any configurations within the VM.

      To add a Required service, click + Add > Add Required Service in the Services tab.

    Note:

    Note the following:
    • To manually connect a supplied service to a required service, select a service and then click and drag the cursor to the second service. A connecting line is added to the blueprint.

    • The services must be of different types (supplied and required) and must be located on separate VM objects. Note that the multiple required services can be connected to a single supplied service.

Adding User Data Scripts

You can add user data scripts to your instance which can be used for automated configuration tasks.

To add user data scripts:
  1. Open your application and select the VM.
  2. On the right side, select General.
  3. Under Cloud Init Configuration, select Cloud-init is installed on this VM.
  4. Add your script in the User Data Script field and save the configuration. Your script will be executed when the machine is booted.
Here are a couple of user data examples:
Example 1:
#!/bin/sh 
echo ‘my_script' > /tmp/my_script
Example 2:
#cloud-config
ssh_import_id: [smoser]
apt_sources: 
- source: "ppa:smoser/ppa”

Viewing the Network Architecture

Verify your network architecture for your application or blueprint on the Network tab of the Application page.

Oracle Cloud Infrastructure Ravello Service allow you to run existing multi-VM applications without any modifications in the cloud. When you drag and drop a VM into the Ravello Canvas, network details including subnets, routers, and supplemental services such as dynamic host configuration protocol (DHCP), domain name service (DNS) servers, and firewalls are automatically updated. The virtual network will look exactly like your data center network.

Running existing applications without any modification in the cloud.

Setting up VM Properties

This section provides a few quick tips to make changes to your network.

IP Configuration

You can add a public IP address, Elastic IP Address, or Port Forwarding to a NIC.
  1. In the Ravello application, select your VM and on the NICs tab click Add IP under IP Configuration.

  2. Select one of the options: DHCP or Static IP, and enter the IP configuration details.

  3. Select Public IP, Elastic IP, or Port Forwarding and save the configuration.

IP Filter

You can define and enable an IP filter that allows traffic only from authorized IP addresses. To enable IP filter:
  1. In the Network tab, navigate to IP Filtering.

  2. Go to Properties to Enable Security Rules. By default, it is disabled to allow traffic from all IP addresses.

  3. Click Security Rules and create rules either to allow or deny the traffic.

  4. Enter the IP address and subnet mask in the mandatory fields and save the configuration.

click the IP Filtering icon on the Canvas page. To allow network traffic only from the specific IP addresses, select Is Active in the IP Filter Properties pane.

Alternatively, you can disable the IP filter and allow traffic from all IP addresses.

Setting anti-affinity rules

Sometimes you may need to set the anti-affinity rule to support high availability. For each unpublished VM, you can assign a group so that the VM on different availability groups are located on separate cloud hosts. However, it is not certain that all the VMs on the same region are located on the same host.
  1. In the Ravello application, select your VM.

  2. To assign a group to the VM, on the General tab, select a group in the Availability Group drop-down list.

    Tip:

    For example, if you want to implement your HA cluster with or without a load balancer, then select one node on Ravello Availability Group 1 and the other node on Ravello Availability Group 2.
  3. Save the configuration.

    Note:

    Once the VM is published, you will not be able to change the availability group.

Publishing Your Application

After you create and validate your application, you can publish your application to cloud.

To publish an application:
  1. After you validate your application, in the Application Canvas workspace, click Publish.
    The Publish Application dialog box is displayed.
  2. Each time you deploy an instance of your application, you can choose to optimize your deployed application for cost or for performance. If you select,
    • Cost Optimization — Ravello auto-selects the best public cloud from the supported region list to meet your application requirements at the lowest possible cost.
    • Performance Optimization — you decide on which specific cloud region your application instance will be deployed, and you experience highest performance possible.
  3. Select the duration for which you want to run the application before it is stopped automatically. The default is 2 hours. If you select Never, then the application will never stop until you manually stop the application.
  4. View the publishing cost for the selected type of optimization, cloud provider, and region in Detailed Pricing.
  5. Click Publish to deploy your application to cloud. The publishing process might take a few minutes.

    Note:

    After you publish an application, you cannot make changes to the Cloud-init configuration where key pair is defined. This setting must be configured in the VM before publishing it to the cloud.
When you publish an application, Ravello mounts its own hypervisor on the cloud and will run your virtual machines directly on it without using any of your hypervisors.