r52 - 07 Aug 2008 - 13:36:10 - BeckyHYou are here: Wiki >  AppLogic23 Web > CliApplication
ALERT! AppLogic 2.3 Beta Documentation The latest production release is AppLogic 2.4.7

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
  login   Log into application
  export   Export application
  import   Import application
  migrate   Migrate application
  provision   Provision application
  get_desc   Display application package descriptor
  put_desc   Modify application package descriptor
  lock   Lock application
  unlock   Unlock application

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
   Name                    : SugarCRM_r1
   Description             : Fully featured, scalable CRM Application, based on SugarCRM's Sugar Open Source 4.0.1 (v4.0.1d-8)
   ID                      : 2
   Documentation URL       : http://doc.3tera.net/AppLogic23/RefAppsSugarCRM.html
   Template                : yes
   Locked                  : no
   User1                   :
   User2                   :
   Destroy on Stop         : no
   State                   : stopped
   CPU                     : 1.65
   Memory                  : 2.25 GB
   Bandwidth               : 9 Mbps
   Default Login Appliance :

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 rename 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
     .destroy_on_stop - Destroy application after it is stopped.
     .doc_url - URL where application documentation can be found.
* 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.
--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
The application start will fail if --debug is specified and the application has field engineering code 16 set.

stop

Description: Stop an application
Syntax: application stop name %BAR --all [ --user | --force ]
Arguments: name Name of application to stop.
--all Stop all applications.
--user Stop all user applications. This option is only valid if --all is specified.
--force Skip user prompt to verify whether it is OK to stop system applications.
Examples: application stop sugarcrm - Stop application 'sugarcrm'
application stop --all - stop all applications
application stop --all --user - stop only user applications
application stop --all --force - stop all applications and do not prompt if system applications should be stopped.
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
The application restart will fail if --debug is specified and the application has field engineering code 16 set.

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.

login

Description: Access the console of the default component of an application. A single component of the application may be specified to provide the console for the application.
Syntax: application login name [--ssh] [console=text|graphic] [--force] [--abort] [command]
Arguments: name Name of application whose console is going to be accessed.
--ssh SSH into the default component of the application (default)
console=text Access a text console of the default component of the application.
console=graphic Access a graphical console of the default component of the application.
--force Take control of console (kill existing console)
--abort Kill existing console (if any)
command Optional command line to execute. If there is more than one argument, the command must be enclosed in quotes (e.g., "ls /tmp"). This argument is only valid if --ssh is specified.
Examples application login sugarcrm --ssh - SSH into default component of application 'sugarcrm'
application login sugarcrm "ls /tmp" - SSH into default component of application 'sugarcrm' and execute ls /tmp
Notes: A single application component may be specified as the default login console by right-clicking on the component within the AppLogic Editor and selecting "Set Default Console" from the context menu.
  This command will fail if the application or default component is not started.
  The ssh login is performed using a special appliances ssh key installed on your grid. This key does not need a passphrase -- it is assumed that if you are logged in on the controller, you are authorized to log in on the appliances. Contact Technical Support if you cannot log in on an appliance or if you believe your appliance key has been compromised and want to have it replaced.
  This command is similar to executing comp login app:comp where app:comp is the name of the component that is specified as the default console of the application.
Only one console type may be specified – ssh, text, graphic.
The --force and --abort options are only valid for text and graphic consoles.
The console=, --force and --abort arguments are supported in AppLogic 2.4+.

export

Description: Export an application
Syntax: application export name dir [ --force ] [ --nocompress | --novols ]
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.
--novols Do not export the application volumes. Supported in AppLogic 2.4+
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 [user=user [pwd=pwd]][ mirrored=val | --novols ]
Arguments: name Name of application to import
|^| dir | Name of exchange directory from which the application is to be imported. The directory may be one of the following:
- directory relative to /vol/_impex
- URL with the following format 'http://path' .|
user Name of user to use for authentication purposes when importing the application from a URL
|^|pwd | Optional password to use for authentication purposes when importing the application from a URL. If set to '-', the user is prompted for the password. |
mirrored If set to 1, create all application's volumes as mirrored. Default is 1 if multi-server grid is configured.
--novols Do not import the application's volumes. Supported in AppLogic 2.4+
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: None.

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: The new descriptor is obtained from standard input. The user can type in or paste the new descriptor contents followed by typing CTRL-d to terminate the input.
The name of the application may not be changed within the new descriptor.
If the operation is executed remotely, the command can be specified as follows: ssh root@controllerhost app put_desc myapp < newdesc where newdesc is a file containing the modified 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 available to grid maintainers ONLY!
When an application is locked, no volumes belonging to the application may be managed and the application may not be modified in any way
See Application and Class Locking Reference for more information.

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 available to grid maintainers ONLY!
See Application and Class Locking Reference for more information.

-- BeckyH - 23 May 2006

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