Last updated on: 2023-08-29 10:06:08.

VNFM CLI

F5 provides two sets of CLI commands:

Install/Uninstall CLI

To remotely connect to VNF Manager, you can install the VNFM Command Line Interface (CLI) on a separate host. The VNFM CLI includes all of the commands necessary to run any actions on VNF Manager. The CLI is deployed by default on the VNF Manager. When connected to the manager via SSH, CLI commands can be executed locally without deploying the CLI.

The VNFM CLI installation package is already downloaded. The installation process does not require an active internet connection.

When you uninstall the VNFM CLI, you only remove the CLI from the local host. This process does not change the configurations on the VNF Manager wo which you used the CLI to connect.

Note

The Python, pip or Virtualenv packages are not removed when you remove the VNFM CLI package.

Do the following to install/uninstall the CLI on your Linux, Windows or Mac environment:

Install CLI on Linux

  1. Locate the downloaded installation package for your package management system, either RPM or DEB.

  2. To install from the CLI on the host, run the command for your operating system.

    Centos/RHEL
        $ sudo rpm -i <pkg.rpm>
    

    Where <pkg.rpm> is the path to the installation file.

    Debian/Ubuntu
       $ sudo dpkg -i <pkg.deb>
    

    Where <pkg.deb> is the path to the installation file.

  3. To uninstall the CLI from the host, run the following command for your operating system.

    #### Centos/RHEL
        $ sudo rpm -e cloudify
    
    #### Debian/Ubuntu
        $ sudo dpkg -r cloudify
    

Install CLI on Windows

The Windows installer is a single executable that installs the following components:

  • Python 2.7.x
  • Pip
  • Virtualenv
  • VNFM CLI

Note

  • If the Python installation shows an error, install make sure that Microsoft Visual C++ 2008 Redistributable is installed.
  • The Python setup wizard prompts you to choose to install pip. If you choose not to install pip, it is installed anyway because it is required by the VNFM environment.
  • Windows security tools may identify the VNFM CLI as an unrecognized app. If this happens, select more info, and then click Run anyway.

To install VNFM CLI on Windows:

  1. Locate the downloaded EXE file, then run the EXE installer and respond to the prompts in the installation wizard.
  2. To uninstall the CLI from the host:
    1. Open Control Panel, and then open Apps.
    2. Select VNFM CLI and click Uninstall.

Install CLI on Mac OSX

  1. Install the package from PyPI (Python Package Index) using python package manager:

    • Pip

      $ sudo pip install cloudify=<VNFM version, for example: 5.0.5>
      
  2. To uninstall the CLI from the host, run:

    pip uninstall cloudify
    

Common options

These options are supported by all VNFM CLI Commands. They can be passed as either an argument to the command itself, for example, vnfm blueprints list -v, or as an argument to vnfm itself, for example, vnfm -v blueprints list, which has the same effect as the previous call.

  • -q, --quiet - Show only critical logs
  • --format [plain|json] - Choose the output format
  • -v, --verbose - Show verbose output. You can supply this up to three times (i.e. -vvv)
  • --json - Force JSON output
  • --manager TEXT - Connect to a specific manager by IP or host
  • -t, --tenant-name TEXT - The name of the tenant of the deployment. If not specified, the current tenant will be used.
  • -o, --pagination-offset INTEGER - The number of resources to skip; for example, --pagination-offset=1 skips the first resource
  • -s, --pagination-size INTEGER - The max number of results to retrieve per page.

Verbose Output

The -v/--verbose flag is available for all commands. It sets the command verbosity level. There are five verbosity levels:

  • Running a command with the --quiet flag limits the log output to critical logs only.
  • Running a command without the verbose flag. (The default).
  • Running a command with -v prints tracebacks where relevant, in addition to the normal output.
  • Running a command with -vv in addition to the tracebacks, displays the DEBUG log statements of local/remote execution events.
  • Running a command with -vvv in addition to the tracebacks and debug log statements, sets all loggers declared in the config file to debug mode.

Note

--debug is equivalent to -vvv

Server maintenance

certificates

The VNFM certificates commands handle certificates’ maintenance procedures. Commands Replacing Certificates are used by VNFM for TLS based secure communication between the different VNFM components and between the user interface and the VNF Manager. Certificates are set during the initial deployment of the VNF Manager (cluster or all-in-one), but later maintenance and replacement of the certificates may be required as a result of regulatory compliance demand, certificate expiration, or revocation due to security breach.

config

The vnfm config command is used to manage VNFM Manager’s configuration. Optional flags vnfm config commands support the common CLI flags. Commands List Usage vnfm config list [OPTIONS] List all configurations Example $ vnfm config list Config:

+------+-------+-------+------------+-------------+---------------------+----+---------+-----------+-------------+-------------+-------+------+-------------------+------+------+------+-----------------------------------+---+-------+-------+------------------+------------------------+------+-------+------------------+-------------+
| name | value | scope | updated_at | is_editable | account_lock_period | -1 | rest    | True      | broker_port | 5671        | agent | True | default_page_size | 1000 | rest | True | failed_logins_before_account_lock | 4 | rest  | True  | file_server_root | /opt/manager/resources | rest | False |  file_server_url | https://172 |
+------+-------+-------+------------+-------------+---------------------+----+---------+-----------+-------------+-------------+-------+------+-------------------+------+------+------+-----------------------------------+---+-------+-------+------------------+------------------------+------+-------+------------------+-------------+

init

The vnfm init command is used to initialize a working VNFM directory. Before you can use vnfm, you must initialize a working directory for it, in which relevant functional information will be stored. Running vnfm intall or vnfm profiles use initializes an environment automatically. Usage vnfm init [OPTIONS] [BLUEPRINT_PATH] Initialize a VNFM environment. This is required to perform many actions and should be the first action performed after installing VNFM.

ldap

The vnfm ldap command is used to set LDAP authentication to enable you to integrate your LDAP users and groups with VNFM. Optional flags These commands support the common CLI flags. Commands set Usage vnfm LDAP set [OPTIONS] Set VNFM Manager to use the LDAP authenticator. Required flags -s, –ldap-server TEXT - The LDAP address against which to authenticate, for example: ldaps://ldap.domain.com. -u, --ldap-username TEXT- The LDAP admin username to be set on the VNFM Manager.

license

The vnfm license command is used to manage VNFM license on the Manager. Optional flags vnfm license commands support the common CLI flags. Commands Upload Usage vnfm license upload [OPTIONS] <license-path> Upload a VNFM license to a Manager. Example $ vnfm license upload vnfm_license.yaml … Uploading VNFM License vnfm_license.yaml to the Manager… VNFM license successfully uploaded. … list Usage vnfm license list [OPTIONS] List details of the VNFM license.

profiles

The vnfm profiles command is used to manage VNFM profiles. Each profile can have its own credentials for managers and VNFM environmental settings and optional flags. These commands support the common CLI flags. Commands list Usage vnfm profiles list [OPTIONS] List all profiles. Example $ vnfm profiles list ... Listing all profiles... Profiles:

+---------------+--------------+----------+----------------+----------+-----------+---------------+------------------+----------------+-----------------+---------+
| name          | manager_ip   | ssh_user | ssh_key_path   | ssh_port | rest_port | rest_protocol | manager_username | manager_tenant | bootstrap_state | *10     |
+---------------+--------------+----------+----------------+----------+-----------+---------------+------------------+----------------+-----------------+---------+

sites

The vnfm sites command is used to manage sites and their location in VNFM Manager. Optional flags vnfm sites commands support the common CLI flags. Commands List Usage vnfm sites list [OPTIONS] List all sites Optional flags

  • --sort-by TEXT - Key for sorting the list.
  • --descending - Sort list in descending order. [default: False] -t,
  • --tenant-name TEXT - The name of the tenant from which to list the sites.

snapshots

The vnfm snapshots command is used to manage data snapshots of VNF manager. You must have admin credentials to create and restore snapshots. You can use the command to create, upload, download, delete and list snapshots and also to restore a Manager using a snapshot archive. For more about working with snapshots, go to: snapshots. Optional flags These commands support the common CLI flags. Commands create Usage vnfm snapshots create [OPTIONS] [SNAPSHOT_ID]

ssh

The vnfm ssh command is used to connect to a VNF manager via SSH. You can use the command to create a new terminal session, run a command, or connect to a shared tmux-based session. Usage vnfm ssh [OPTIONS] Connects to a running manager via SSH. host starts a tmux session (for example, tmux new -s ssh_session_vi120m) after which a command for a client is printed in the tmux session for the host to send to the client.

tenants

The vnfm tenants command is used to create and manage tenants on VNFM Manager. You can run commands on a tenant other than the one that you are logged into by specifying the name of the tenant to which the command applies. For example, vnfm tenants add-user USERNAME -t TENANT_NAME can be used to add a user to a different tenant. Requirements To use the command you must have VNFM sys_admin credentials.

user-groups

The vnfm user-groups command is used to define and manage user groups on VNFM Manager. To use the command you must have VNFM admin credentials. If your VNFM Manager is integrated with LDAP/AD. ensure that the group names that you define exactly match those defined in LDAP. Requirements To use the command you must have VNFM admin credentials. User names and passwords must conform to the following requirements:

users

The vnfm users command is used to manage users and passwords on VNFM Manager. If you choose not to integrate VNFM Manager with LDAP-based user management system, you must add each user individually with a unique username and a password.You can also create user groups and add users to them. The users and user groups can be assigned to one or more tenants, with different roles in each tenant.

Orchestration

The VNFM command-line interface (CLI) is the default method for interacting with the VNFM management environment, to manage your applications. It enables you to execute workflows on your local machine, and to interact with a running VNF Manager via SSH to upload and delete blueprints, create deployments, execute workflows, retrieve events, and more.

Working locally refers to running workflows directly from the machine on which the CLI is installed. Working with an instance of VNF Manager refers to executing workflows directly from that VNF Manager instance.

When you use the CLI to control a VNF Manager instance, additional commands appear in the CLI that are not available for use in local mode, for example communicating with a running VNF Manager using SSH, downloading its logs, creating snapshots, uploading plugins and so on.

If you attempt to run a command that is not supported in local mode, an error message is returned advising you that the command is only supported when using VNF Manager. To use a VNF Manager, you can run vnfm profiles use.

If you haven’t already installed VNFM, now would be a good time to do so.

Usage

You can access the CLI by running the vnfm command in your terminal. Use vnfm -h to display a list of all the commands and their descriptions.

vnfm -h
Usage: vnfm [OPTIONS] COMMAND [ARGS]...

  VNFM's Command Line Interface

  Note that some commands are only available if you are using a Manager. You
  can use VNF Manager by running the `vnfm profiles use` command and providing
  it with the IP of the your manager (and SSH credentials if applicable).

  To activate bash-completion, run `eval "$(_CFY_COMPLETE=source vnfm)"`

  VNFM's working directory resides in ~/.cloudify. To change it, set the
  variable `CFY_WORKDIR` to the appropriate directory (e.g. /tmp/).

Options:
  -v, --verbose  Show verbose output. You can supply this up to three times
              (i.e. -vvv)
  --version      Display the version and exit (if a manager is used, its
              version will also show)
  -h, --help     Show this message and exit.

Commands:
  agents            Handle a deployment's agents
  apply             Install a blueprint or update existing deployment with blueprint [manager only]
  blueprints        Handle blueprints on the manager
  deployments       Handle deployments on the Manager
  dev               Run fabric tasks [manager only]
  events            Show events from workflow executions
  executions        Handle workflow executions
  groups            Handle deployment groups
  init              Initialize a working env
  install           Install an application blueprint [manager only]
  ldap              Set LDAP authenticator
  logs              Handle manager service logs
  maintenance-mode  Handle the manager's maintenance-mode
  node-instances    Handle a deployment's node-instances
  nodes             Handle a deployment's nodes
  plugins           Handle plugins on the manager
  profiles          Handle VNFM CLI profiles Each profile can...
  secrets           Handle VNFM secrets (key-value pairs)
  snapshots         Handle manager snapshots
  ssh               Connect using SSH [manager only]
  ssl               Handle the manager's external ssl
  status            Show manager status [manager only]
  tenants           Handle VNFM tenants [Premium feature]
  uninstall         Uninstall an application blueprint [manager only]
  user-groups       Handle VNFM user groups [Premium feature]
  users             Handle VNFM users
  workflows         Handle deployment workflows
...

Note

Some features, like viewing metric graphs and application topologies, are only available using the VNF Manager Console if you are running VNF Manager.

Inputs and Parameters

For commands that accept inputs or parameters (for example, vnfm executions start or vnfm deployments create) the value must represent a dictionary. Valid formats are:

  • A path to the YAML file
  • A path to a directory containing one or more YAML files
  • A wildcard-based path to one or more YAML files
  • A string in JSON format
  • A string formatted as “key1=value1;key2=value2”

Configuration

By default, a .cloudify directory is created under ~(Home directory). You can change the location using an _env_ variable (for example, vnfm init or vnfm profiles use).

The directory contains a file named config.yaml that you can customize according to your preferences.

Configurable Parameters

You can configure the parameters described in this section.

  • Colored Output - Enables colored output of different vnfm commands: colors: true default value is false.

  • Logging - Specifies the path of the log file that vnfm writes to:

    logging:
      filename: /some/custom/path/to/a.log
    

    The default value is $TMPDIR/cloudify-$USERNAME/cloudify.log.

  • Configure specific python logger levels:

    logging:
      loggers:
        cloudify.rest_client.http: debug
        some.external.package: debug
    

    The default sets the cloudify.cli.main and cloudify.rest_client.http loggers’ logging level to info.

Note

The .cloudify directory can also contain other files and directories, which are used internally by vnfm, that are not described in this section.

Commands include:

agents

Used to manage VNFM agents on existing deployments.

blueprints

Used to manage blueprints on a VNF Manager instance.

deployments

Used to manage running deployments on a VNF manager.

dev

Used to run fabric tasks on a VNF manager via SSH.

events

Used to view events of a specific execution.

executions

Used to manage workflow executions on VNF Manager.

groups

Used to view information on the different groups in a deployment.

install

Used to install an application using a VNF manager without having to manually go through the process of uploading a blueprint, creating a deployment and executing a workflow.

logs

Used to manage log files on VNF Manager.

maintenance-mode

Used to restrict REST access to the manager.

node-instances

Used to view information about the different node-instances of a deployment.

nodes

Used to view information on the different nodes of a deployment.

plugins

Used to manage plugins stored on a VNF manager.

secrets

Used to manage VNFM secrets (key-value pairs).

status

Used to display the status of a running VNF Manager.

tokens

Used to receive a REST token from the VNF Manager.

uninstall

Used to uninstall an application using VNF Manager, without having to manually go through the process of executing a workflow, deleting a deployment and deleting a blueprint.

workflows

Used to view information about the different workflows of a deployment.

What’s Next?