r38 - 12 Mar 2008 - 12:50:55 - BeckyHYou are here: Wiki >  AppLogic2 Web > CliApplication
led-green December 24 - AppLogic 2.4.7 is now available and is the latest production release!

Application Control and Management Commands

The following commands are supported:

      Command       Description
  list   List applications
  info   Retrieve application information
  create   Create application
  destroy   Destroy application
  rename   Rename application
  copy   Copy application
  config   Configure application
  start   Start application
  stop   Stop application
  continue   Continue starting application
  restart   Restart application
  build   Build application
  clean   Clean application
  export   Export application
  import   Import application
  migrate   Migrate application
  provision   Provision application
  get_desc   Display application package descriptor (Supported in Applogic 2.3.0+)
  put_desc   Modify application package descriptor (Supported in Applogic 2.3.0+)
  lock   Lock application (Supported in Applogic 2.1.1 with hotfix e2106 or later)
  unlock   Unlock application (Supported in Applogic 2.1.1 with hotfix e2106 or later)

list

Description: List applications
Syntax: application list [ --active ] [ --template ] [ --batch ] [ --verbose ]
Arguments: --active List only active (i.e., running) applications
--template List only template applications.
--batch Display output in UDL format.
--verbose Include application ID and description in output.
Examples: application list - List all applications with their descriptions
Notes: A specification of the output of this command can be found here.
Typical Output

Name                  State     Template
-------------------------------------------
GSC_1_2_1_1           stopped   yes
Lamp_1_0_3_1          stopped   yes
LampCluster_1_1_1_1   stopped   yes
LampX4_1_0_3_1        stopped   yes
SugarCRM_4_0_1_d_7    stopped   yes
TWiki_4_0_2_5         stopped   yes
sugarcrm              stopped   no

info

Description: Display application information
Syntax: application info name [ --batch ] [ --verbose ]
Arguments: name Name of application for which to display information
--verbose Include detailed information for each component
--batch Display output in UDL format
Examples: application info sugarcrm - Display information for application 'sugarcrm'
Notes: A specification of the output of this command can be found here.
Typical Output
AppLogic 2.1.1 with hotfix e2106 and later
   Name              : sugarcrm
   Description       : Scalable CRM application
   ID                : 3
   Template          : no
   Locked            : no
   User1             :
   User2             : 
   State             : running
   Time Started      : Fri Aug 25 10:47:40 2006
   Total Components  : 9
   Running Components: 9
   cpu               : 0.27
   mem               : 448 MB
   bw                : 9  Mbps

Previous versions
   Name              : sugarcrm
   Description       : Scalable CRM application
   ID                : 3
   Template          : no
   User1             :
   User2             : 
   State             : running
   Time Started      : Fri Aug 25 10:47:40 2006
   Total Components  : 9
   Running Components: 9
   cpu               : 0.27
   mem               : 448 MB
   bw                : 9  Mbps

create

Description: Create an application
Syntax: application create name
Arguments: name Name of application to create
Examples: application create sugarcrm - Create application 'sugarcrm'
Notes: This command will fail if there is already an application installed with the same name. The result of this command is that a directory is created for the application under the AppLogic/apps directory and template binding and application descriptors are created.

destroy

Description: Destroy an application
Syntax: application destroy name [ --force ]
Arguments: name Name of application to destroy
--force Do not ask the user anything
Examples: application destroy sugarcrm - Destroy application 'sugarcrm'
Notes: If the application is running, this command will fail.
If the --force option is not specified, the user is asked if he really wants to destroy the application. The result of this command is: All volumes, component descriptors, and application descriptor are deleted. The application directory under the AppLogic/apps directory is also deleted.

rename

Description: Rename an application
Syntax: application rename name new-name
Arguments: name Name of application to rename
new-name New name of application
Examples: application reanme sugarcrm sugarnew - Rename application 'sugarcrm' to 'surgarnew'
Notes: This command will fail if the application is currently running or if there is already an application installed as new-name.

copy

Description: Copy an application
Syntax: application copy name new-name [--fscpy [--prefill]]
Arguments: name Name of application to copy
new-name New name of application
--fscpy Copy volumes using filesystem-level copy rather than block-level copy. This is useful if the application contains a large volume that has little data stored on it.
--prefill Allocate ALL blocks of the volume.
Examples: application copy sugarcrm sugarnew - Copy application 'sugarcrm' to 'surgarnew'
Notes: Copy is like export + import with no intermediate packaged storage. This command will fail if the application is currently running or if there is already an application installed as new-name.

config

Description: Configure an application
Syntax: application config name [--batch]
application config name --boundary
application config name [--reset ] [ prop>=val]* [--d prop]* [ --partial ] [--verify ]
application config name [ prop=val]* [--d prop]* --test-only [ --partial ] [--verify ]
application config name --stdin [--test-only] [ --partial ] [--verify ]
Arguments: name Name of application to configure
--boundary Show application boundary (i.e., list of properties that may be configured).
--reset Reset all properties to default.
prop=val Change a property setting.
--d prop Reset property to default.
--test-only Test provided configuration parameters, do not set.
--partial Skip verification that all mandatory properties are set. As of Applogic 1.5, this option is provided for backward compatibility only (i.e., no-op).
--batch Display output in UDL format.
--stdin Read configuration parameters to be set from standard input.
--verify Verify that all mandatory properties are set.
Examples: app config SugarCRM - Show current configuration for SugarCRM
application config SugarCRM --boundary - Show configurable parameters for SugarCRM
application config SugarCRM --reset - Reset app configurable parameters for SugarCRM to defaults
application config SugarCRM --stdin < sugar.params - configure application using settings contained within the file sugar.params.
application config MyApp .template=1 --partial - configure application as a template so that it may be later provisioned.
Notes: Application configuration parameters specified by prop can be one of the following:
* .name - attribute, attributes can be:
     .description - Free form text describing application
     .template - 0/1 - must be set in order for application to be provisioned
     .user1, .user2 - Free form text used for client billing information
* name - property
* resource.val - resource, resource can be cpu, mem, bw val can be min, max, dflt
* vol. name - volume
* servers. val - set servers, val can be min, max, set.
When configuring an application using the --stdin option, the format of the input should be similar to the output of the following command: app confiig name --batch.
As of Applogic 1.5, this command will not validate that all mandatory properties are set by default. To enable the property validation, specify the --verify option.
A specification of the output of this command can be found here.

start

Description: Start application
Syntax: application start name ( prop=val )* [ --debug ] [ --norestart ] [ --skipbuild ] [ --cap_cpu ]
Arguments: name Name of application.
prop=val Parameters for scheduling. The following parameters may be specified:
cpu - (optional) CPU allocation in whole CPUs or percent (val[%])
mem - (optional) Memory allocation (val[M[B]|G[B]]). If units are not specified, memory is specified in MB.
bw - (optional) Bandwidth allocation (val[M[b]|G[b]]). If units are not specified, bandwidth is specified in Mbps.
sched - String specifying scheduling target (see below)
servers - Number of servers on which application is to be started;
--debug Start application in debug mode. SCR 779
--norestart Do not restart application upon grid failure.
--skipbuild Do not build application prior to start.
--cap_cpu Enable the capping of CPU for all components of the application.
Examples: application start sugarcrm - Start application 'sugarcrm'
Notes: The following scheduling targets are supported:
sched="percentile=(resource percentile)"
sched=crunch - assign the minimum resources to all components, same as "percentile=0"
sched=expand - assign the maximum resources to all components, same as "percentile=100"
sched="mode=(scheduling mode)", valid values are one of the following:
* 1 - pack servers, schedule appliances on server with least amount of available resources
* 2 - round robin with random start, randomly schedule first appliance to a server and then assign remaining appliances to other servers using round robin
* 3 - round robin, schedule first appliance on the first server and then assign remaining appliances to other servers using round robin

stop

Description: Stop an application
Syntax: application stop name
Arguments: name Name of application to stop. If name is --all, then all applications are stopped (PLEASE DO NOT USE --all; MAY CAUSE 1 OR MORE SERVERS TO CRASH, DEFECT SCR 1323).
Examples: application stop sugarcrm - Stop application 'sugarcrm'
Notes: None.

continue

Description: Continue starting an application.
Syntax: application continue name
Arguments: name Name of application to continue starting
Examples: application continue sugarcrm - Continue starting application 'sugarcrm'
Notes: This command is used to continue the starting of an application that was started with --debug option and one of the components of the application failed to start.

restart

Description: Restart application
Syntax: application restart name ( prop=val )* [ --debug ] [ --clean ] [ --norestart ] [ --skipbuild ] [ --cap_cpu ]
Arguments: name Name of application.
prop=val Parameters for scheduling. The following parameters may be specified:
cpu - (optional) CPU allocation (val[%])
mem - (optional) Memory allocation (val[M[B]|G[B]]). If units are not specified, memory is in MB.
bw - (optional) Bandwidth allocation (val[M[b]|G[b]]). If units are not specified, bandwidth is in Mbps.
sched - String specifying scheduling target (see below)
servers - Number of servers on which application is to be started;
--debug Restart application in debug mode. SCR 779
--clean Clean application prior to restart.
--norestart Do not restart application upon grid failure.
--skipbuild Do not build application prior to restart.
--cap_cpu Enable the capping of CPU for all components of the application.
Examples: application restart sugarcrm - Restart application 'sugarcrm'
Notes: None.
This command combines application stop and start commands.
The --clean and --skipbuild options may not be specified at the same time.
The following scheduling targets are supported:
sched="percentile=(resource percentile)"
sched=crunch - assign the minimum resources to all components, same as "percentile=0"
sched=expand - assign the maximum resources to all components, same as "percentile=100"
sched="mode=(scheduling mode)", valid values are one of the following:
* 1 - pack servers, schedule appliances on server with least amount of available resources
* 2 - round robin with random start, randomly schedule first appliance to a server and then assign remaining appliances to other servers using round robin
* 3 - round robin, schedule first appliance on the first server and then assign remaining appliances to other servers using round robin

build

Description: Build an application
Syntax: application build name
Arguments: name Name of application to build
Examples: application build sugarcrm - Build application 'sugarcrm'
Notes: This command will fail if the application has already been started or is in an intermediate state.

clean

Description: Clean an application
Syntax: application clean name
Arguments: name Name of application to clean
Examples: application clean sugarcrm - Clean application 'sugarcrm'
Notes: This command will fail if the application has already been started or is in an intermediate state.

export

Description: Export an application
Syntax: application export name dir [ --force ] [ --nocompress ]
Arguments: name Name of application to export
dir Name of exchange directory relative to /vol/_impex where application is to be exported
--force Overwrite contents of dir if not empty. If not specified and dir is not empty, this command will fail.
--nocompress Do not compress the volume images.
Examples: application export sugarcrm sugar - Export application 'sugarcrm' to /vol/_impex/sugar
Notes: If the application is running, this command will fail.
At the conclusion of this command, the application's packing slip is created and all descriptors, images, etc. are copied to the destination directory.
Applications exported from grids running AppLogic 1.2.12 and later may not be imported on a grid running Applogic 1.2.11 and earlier due to a defect in the earlier versions. However, applications exported from earlier versions of AppLogic may be imported on a grid running a later version of AppLogic.
When exporting an application from a grid running AppLogic 1.2.12 and later with the intention of importing the application on a grid running an older version of AppLogic, the application must be exported with --nocompress option.

import

Description: Import an application
Syntax: application import name dir [ mirrored=val ]
Arguments: name Name of application to import
dir Name of exchange directory relative to /vol/_impex from which application is to be imported
mirrored If set to 1, create all application's volumes as mirrored. Default is 1 if multi-server grid is configured.
Examples: application import sugarnew sugar - Export application 'sugarnew' from /vol/_impex/sugar
Notes: Applications exported from grids running AppLogic 1.2.12 and later may not be imported on a grid running Applogic 1.2.11 and earlier due to a defect in the earlier versions. However, applications exported from earlier versions of AppLogic may be imported on a grid running a later version of AppLogic.
When exporting an application from a grid running AppLogic 1.2.12 and later with the intention of importing the application on a grid running an older version of AppLogic, the application must be exported with --nocompress option.

migrate

Description: Migrate an application from a remote grid to this grid
Syntax: application migrate src_grid app [ .name=newapp ] [ --nocompress ] [ --nocleanup ] [ --debug ] [ (prop=val)* ]
Arguments: src_grid Name of grid on which application resides.
app Name of application to migrate
.name=newapp Optional new name for migrated application.
--nocompress Do not compress application volumes during migration. This option is useful when migrating applications that have large volumes.
--nocleanup skip cleanup upon failure or completion (troubleshooting)
--debug show debug information during migration (troubleshooting)
prop=val config parameter pairs as used for the application config command.
Examples: app migrate myoldgrid.3tera.net myapp - migrate application 'myapp' from grid 'myoldgrid.3tera.net' to current grid.
application migrate grid1.3tera.net crm7 usr_ip=64.4.47.21 out_ip=64.4.47.22 - Migrate application 'crm7' from grid 'grid1.3tera.net' and set its 'usr_ip' and 'out_ip' properties.
application migrate myoldgrid.3tera.net myapp .name=mynewapp - migrate application 'myapp' from grid 'myoldgrid.3tera.net' to current grid and rename application to 'mynewapp'.
Notes: If the original application is running, it will be stopped prior to the migration. Upon completing the migration, the new application will be started. If the original application was not started, the new application will not be started.
When accessing the grid via SSH, SSH agent and agent forwarding must be enabled on the client machine for the remote grid access to work. In addition, either the user's and/or the grid's public SSH key must also be installed on the remote grid in order to set up a "trust" between the two grids.
see app config for help on properties and resources. The full and per-property reset are not supported (--reset and -d ).
An application can not be migrated from a grid running AppLogic 1.2.12 and later to a grid running a version of AppLogic earlier than 1.2.12. This is due a defect in the earlier versions. However, the application may be migrated manually by following the following steps:
1. export the application with --nocompress option; see export
2. transfer the exported application to the remote grid
3. import the application; see import

provision

Description: Provision an application
Syntax: application provision template target [ (vol.size=val)* ] [ (param=val)* ] [ --skipstart ] [ --fscpy [--prefill]]
Arguments: template Name of template application from which to provision the application
target Name of application to provision; must not exist
vol.size=val Specify size of application user and singleton class volumes. Units may be specified (e.g, 128M[B], 2G[B]). If units are not specified, it is assumed that the specified value is in MB. The format of vol is one of the following:
name - application user volume
class.name - application singleton class volume
param=val Parameter to set on the application. The format of each parameter is the same as that specified for 'app config'.
--skipstart Do not start application after provisioning process is done. Note, the application is configured if parameters are specified.
--fscpy Perform filesystem-level copy when copying volumes. This is useful if the application has largge data volumes that have little data stored on them.
--prefill Allocate ALL blocks of the volume.
Examples: app provision SugarCRM crm7 usr_ip=64.4.47.21 out_ip=64.4.47.22 data.size=64M - Provision crm7 application using SugarCRM as a template, resize the data volume, and set its usr_ip and out_ip properties prior to start.
Notes: This command will fail if the template application is running.
As of Applogic 1.2.5 this command will fail if the template application does not have the template attribute set - see app config.
This operation is similar to 'application copy' with added volume resizing, configuration, and application start.

get_desc

Description: Display application package descriptor
Syntax: application get_desc app
Arguments: app name of application for which package descriptor is to be displayed
Examples: application get_desc my-app - display package descriptor for application my-app
Notes: Supported in Applogic 2.3.0+

put_desc

Description: Modify application package descriptor
Syntax: application put_desc app
Arguments: app name of application for which package descriptor is to be modified
Examples: application put_desc my-app - modify package descriptor for application my-app
Notes: Supported in Applogic 2.3.0+
The new descriptor is obtained from standard input.
The application name may not be changed within the new descriptor.

lock

Description: lock an application
Syntax: application lock app
Arguments: app name of application to be locked
Examples: application lock my-app - Lock application my-app
Notes: This command is supported in AppLogic 2.1.1 with hotfix e2106 or later
This command is available to grid maintainers ONLY!
When an application is locked, no volumes belonging to the application may be mounted and the application may not be modified in any way

unlock

Description: unlock an application
Syntax: application unlock app
Arguments: app name of application to be unlocked
Examples: application unlock my-app - Unlock application my-app
Notes: This command is supported in AppLogic 2.1.1 with hotfix e2106 or later
This command is available to grid maintainers ONLY!

-- BeckyH - 23 May 2006

 
Copyright © 2005-2008 3tera, Inc. All Rights Reserved.
%