Deploying an Application

This topic takes you through booting up the JunosV App Engine and deploying an application on the JunosV App Engine.

Required Hardware and Software

In order to install and use the JunosV App Engine platform, please make sure you have the following items:

  1. Hardware and Software Platform Components: To deploy a remote application—an application written using the JunosV App Engine development environment—you must first set up the JunosV App Engine platform. You will need the following hardware and software platform components.

    • Device running Junos: For the 13.2R1 release this is an M Series, an MX Series, or a T Series router. You need to make sure you have enough space to store the downloads, approximately 1.9 GB.
    • VSE device: This could be either a VSE1100 or VSE2100 device. For VSE device chassis specifications, see Device Features and Specifications in the Virtual Services Engine Hardware Installation Guide.
    • DHCP server: You need a DHCP server for the PXE boot-up of the VSE device. You can use a dedicated DHCP server or the Juniper Networks router your VSE device is tethered to as the DHCP server. You will need to purchase a DHCP license in the following circumstances:
      • If you are using the DHCP server functionality on a Juniper Networks M Series or MX Series router
      • If you have your own DHCP server and are relaying DHCP messages through a Juniper Networks M Series or MX Series router If, however, the DHCP messages go directly to the VSE device, you do not need any additional licenses.

      For more details on what licenses to buy, see the configuration topic Configuring the DHCP Server and TFTP Server for Compute Nodes.

    • Console server: This device is optional and used mainly for debugging purposes.
  2. Software Packages: You also need the following software:

    • Junos OS package, Release 12.3R1 or later

      Note: As of Junos OS Release 12.3, JunosV App Engine deployed applications will install only if the Junos OS release matches the release of the backing sandbox used to package the application. For example, an application packaged with Release 12.3R2 will only install on Junos OS Release 12.3R2 and will not install on Junos OS Release 12.3R1 or Junos OS Release 12.3R3 or Junos OS Release 13.1R1.

    • JunosV App Engine Host Base OS: jvae-release-version.tgz

      This package, also referred to as the JunosV App Engine Software, contains the JunosV App Engine Host Base operating system (OS). There is only one version of the JunosV App Engine Host Base OS that can be installed at one time. Make sure you are running the same release of Junos OS (jinstall-release-version.tgz) as the JunosV App Engine Host Base OS package you are going to install.

      Note: To download this software package, see the JunosV App Engine Download Site.

    • A remote application package—optional if you just want to boot the VSE device

      A remote application package is not supplied at the download site. You get this package from the provider of the application.

    When you download the packages, verify that the MD5 and SHA1 checksums of the downloaded files match those of the corresponding files on the download website.
  3. Development Certificate: If you have not already received a development certificate, please contact JunosV App Engine technical marketing team at sdk-cert@juniper.net. You will need the certificate when you begin packaging your custom application.

Boot the JunosV App Engine

On the VSE device, there are two sets of four ports for the VSE1100 device and one set of four ports and one set of two ports for the VSE2100 device. The set of four ports on the left side when you are facing the VSE device are onboard ports. The other ports are IOC ports. The onboard ports are interfaces named eth0 to eth3 going from leftmost to right as you face the device. The IOC ports are numbered eth7 down to eth4 going from leftmost to right. See Figure 1.

Figure 1: Interface Mapping to Ports on a VSE 1100 Device

Interface Mapping to Ports on a VSE
1100 Device

To deploy an application you need boot the VSE device first and then install the application package.

To boot the JunosV App Engine:

  1. Connect the router running Junos OS and the VSE device:
    1. Choose any one of the VSE device interfaces as the management interface. Make sure there is a physical or Layer 2 connection from this interface to the router.
    2. (Optional, but required for remote power cycling.) Connect the console port on the left side of the VSE device to a console server.
    3. Write down the MAC address of the interface you have connected the router to.

      The MAC address of the management interface is required for completing the installation (Step 2). There are labels on the back of the VSE chassis with the MAC addresses of the interfaces.

      When the VSE device powers on and attempts to PXE boot, the MAC addresses of onboard interfaces are displayed. You can also monitor the console log for this information.

  2. Install the software packages on the router and VSE device.
    1. Verify you have the correct release of the Junos OS installed on the router (12.3R1 or later and a release matching rhw release of the backing sandbox used to package the application).
    2. Install the JunosV App Engine Host Base OS package on the router. Go to the operational mode of the CLI to issue the following command.
      user@router> request system software add jvae-release-version.tgz

      This package contains the JunosV App Engine Host Base OS. The JunosV App Engine Host Base OS is installed on the VSE device based on the platform configuration in Step 3. Currently, only one version of the JunosV App Engine Host Base OS can be installed at one time.

  3. Configure the platform layer.

    Configure the physical connection between the router running Junos OS and the VSE device. You do this at the [edit services app-engine compute-cluster] hierarchy level. For details on options, see the compute-cluster (App Engine) configuration statement section. Links to child configuration statements are provided in the Syntax section of the configuration statement sections.

    Here is an example of the configuration you must set. Use the configuration mode of the CLI to configure the settings. A minimum of one interface is required to boot the VSE device.

    [edit services app-engine]user@router# show
    compute-cluster cc1 {local-management {family inet {address 192.168.1.20; # The IP address of the interface on the router # tethered to the VSE device}}compute-node cn1 {mac-address 00:e0:81:ca:5a:76; # The MAC address of the interface on the VSE # device that is used to tether it to the routerinterfaces {bridge br0 {management;family inet {address 192.168.1.11/24; # IP address belongs to the bridge. # You can ssh to this address or use the console to monitor the VSE device}interface eth0; # Physical interface on the VSE device tethered to the router.}}}}

    The IP address under the [edit services app-engine compute-cluster ccl local-management family inet address] hierarchy level is the interface that is used to manage the entire compute cluster.

    You can use the FreeBSD shell to check the VSE connection at the interface address 192.168.1.11/24. Type ssh root@192.168.1.11 and enter the password when prompted. You can also use the console to monitor the VSE device.

  4. Configure the TFTP server and the DHCP server.

    BIOS is enabled for PXE boot at the time of manufacture for all VSE device interfaces. This step shows how to enable PXE boot of the VSE device by configuring the Junos router as a DHCP server. For more examples and information about DHCP configuration, see the configuration topic Configuring the DHCP Server and TFTP Server for Compute Nodes.

    1. To enable the TFTP server on Junos:
      • Use the following set command:
        user@router# set system services tftp-server
    2. To configure the Junos router as a DHCP server:
      1. Configure the dhcp-local-server group statements at the [edit system services] hierarchy level.
        [edit]user@router# set system services dhcp-local-server group group-name interface interface-name

        For example:

        user@router# set system services dhcp-local-server group dhcp-group1 interface ge-4/2/0.0
      2. Configure the DHCP attributes. For example, use these set commands:
        # set access address-assignment pool dhcp-pool family inet network 192.168.1.0/24# set access address-assignment pool dhcp-pool family inet dhcp-attributes router 192.168.1.20# set access address-assignment pool dhcp-pool family inet dhcp-attributes boot-file pxelinux.0# set access address-assignment pool dhcp-pool family inet dhcp-attributes boot-server 192.168.1.20# set access address-assignment pool dhcp-pool family inet dhcp-attributes tftp-server 192.168.1.20
      3. Configure the host interface MAC address and IP address. For example:
        # set access address-assignment pool dhcp-pool family inet host dhcp-node hardware-address 00:e0:81:ca:5a:76# set access address-assignment pool dhcp-pool family inet host dhcp-node ip-address 192.168.1.251
      4. Commit your configuration.
        [edit] user@router# commit commit complete
  5. Boot the VSE device.

    If you have not already done so, power on the VSE device. Depending on the interface you chose to connect to your router, you may have to wait for the VSE device to find the management connection and boot.

  6. Verify your configuration.
    1. Verify the TFTP and DHCP server configuration with the show command.
      [edit]
      
      user@router# show interfaces
      ge-4/2/0 {# interface on router to which VSE device is tethered
          unit 0 {
              family inet {
                  address 192.168.1.20/24;
              }
          }
      }
       
      [edit]
      
      user@router# show system services
      tftp-server;
      dhcp-local-server 
          group dhcp-group1 {
              interface ge-4/2/0.0;
          }
      }
      [edit]
      
      user@router# show access
      address-assignment {
          pool dhcp-pool {
              family inet {
                  network 192.168.1.0/24;
                  dhcp-attributes {
                      router {
                          192.168.1.20;
                      }
                      boot-file pxelinux.0;
                      boot-server 192.168.1.20;
                      tftp-server 192.168.1.20;
                  }
                  host dhcp-node {
                      hardware-address 00:e0:81:ca:5a:76;
                      ip-address 192.168.1.251;
                  }
              }
          }
      }
      
    2. Verify the status of your connection using the show app-engine status command. This command is an operational command. Exit from configuration mode in the CLI.
      user@router> show app-engine status
      Compute cluster: cc1
       Compute node    Status
       cn0             Online
      

      This is the status of the App Engine. Online indicates that the node is booted and ready to accept virtual machines.

Deploy an Application

The rest of this section gives step-by-step instructions on deploying an application on the JunosV App Engine.

To deploy an application on a running JunosV App Engine:

  1. Authorize the application on the router and VSE device.

    As the operator, you will need to authorize installation of the application package on your router and VSE device.

    1. Go to the configuration mode of Junos CLI and then go to the [edit system extensions] hierarchy level.
    2. Configure and commit the provider name, the license type, and the deployment scope associated with the application package. This information is supplied by the application package provider.
      [edit system extensions] user@router# set providers name license-type license deployment-scope deployment

      For example, if you were to install an application provided by Juniper Networks, you might configure and commit the following authorization settings:

      [edit system extensions] user@router# set providers juniper license-type juniper deployment-scope commercial

      If you do not authorize the application in this way, you will get this error message:

      ERROR: validate-config: Packages from juniper are not allowed WARNING: Current configuration not compatible with /var/tmp/package-name
  2. Install the application package on the router.

    This software is not provided on JunosV App Engine download site; it comes from the provider of the application.

    user@router> request system software add app-package-name-release-version.tgz

    The software is deployed on top of JunosV App Engine platform as a guest VM.

  3. Configure and provision the virtual machines (VMs).

    The VMs are where the applications run. Each application runs on its own guest OS. Configure and provision the VMs at the [edit services app-engine virtual-machines] hierarchy level. For details on options, see the instance configuration statement section. Links to child configuration statements are provided in the Syntax section of the configuration statement sections.

    Here is an example of the configuration you must set:

    [edit services app-engine]user@router# show
    virtual-machines {instance helloworld-vm {package sample-jvae-app-ve;compute-cluster cc1 {compute-node cn1;}interface eth0 {bridge br0;family inet {address 192.168.1.12/24;}}}}

    Tip: If the control traffic to and from the VMs and router is not too much, you should make the VM IP address be part of the same subnet as the compute node management IP address. This strategy uses fewer physical ports than is required to form a separate VM network.

  4. Commit the configuration and exit. When you commit your configuration, the system transfers the disk image of the VM, which is the part of the package installed on the Routing Engine, to the VSE device, and uses this disk image to boot up.
    1. Commit the changes to the configuration.
      [edit] user@router# commit commit complete
    2. Exit the configuration mode.
      [edit] user@router# exit Exiting configuration mode
  5. Verify the configuration with show commands.
    1. Use the show app-engine virtual-machine package command to show the status of the download of the package.
      user@router> show app-engine virtual-machine package
      VM package: sample 
      VM disk image: sample.img.gz 
        Compute cluster               Package download status 
        cc1                           DOWNLOADED                
    2. Use the show app-engine virtual-machine instance command to show the status of the VM. If the host manager is able to bring up the VM, the status is Active.
      user@router> show app-engine virtual-machine instance
      VM name                  Compute cluster           VM status 
      sample                   cc1                       Active  

      The detail version of this command gives the following additional information:

      user@router> show app-engine virtual-machine instance detail
      VM name: sample 
        VM status: ACTIVE 
        Compute cluster name: cc1 
        Compute node name: cn1 
        VM UUID: cfe28222-f142-11e1-ba37-00e081cbbc57 
        VM disk image: sample.img 
        Number of CPUs: 1 
        Memory (GB): 1 
        Console: 192.168.1.11 15001 
        VM PID: 6824 
        eth0: 192.168.1.12 
        hda: 8 GB

      The VM has a virtual console with the connectivity information as displayed (see the Console field in the output from the detail command above). You can log on to the VM console from the Juniper Networks device’s FreeBSD shell. You can drop to the FreeBSD shell by typing start shell. From there you can log on to the VM console by typing telnet 192.168.1.11 15001, for example.

      You can also ssh to the IP address of the management interface of the VM (see the eth0 field in the output from the detail command above) if ssh has been enabled inside the VM.

You are now ready to run the application.

Related Documentation