跳到主要内容

Node Management Commands: node

List all nodes: ls

Entry:

lbg node ls

Overview:

usage: lbg node ls [-h] [-q] [-s] [-w] [-t] [-p] [--csv] [--json] [--yaml]
[--table] [--noheader]

options:
-h, --help show this help message and exit
-q, --quiet only show node id
-s, --started only show started node
-w, --waiting only show waiting node
-t, --pending only show pending node
-p, --paused only show paused node
--csv output with csv format
--json output with json format
--yaml output with yaml format
--table output with table format
--noheader does not print header information

Parameter description:

ParameterAbbreviationDescriptionRequired
--quiet-qDisplay only node idNo
--started-sDisplay only started nodesNo
--waiting-wDisplay only waiting nodesNo
--paused-pDisplay only paused nodesNo

Example:

$ lbg node ls --yaml # View all nodes and output in yaml format
$ lbg node ls -paused -waiting # View all paused and waiting nodes

Create Node: create

Entry:

lbg node create -i IMAGE_ID -s SCASS_TYPE -d DISK_SIZE

Overview:

usage: lbg node create [-h] [-f] node_id [node_id ...]

positional arguments:
node_id id of the node

options:
-h, --help show this help message and exit

Parameter description:

ParameterAbbreviationDescriptionRequired
--name-nNode nameNo
--image_id-iImage id to be usedYes
--scass_type-sNode configuration, for configuration information please refer to Machine ConfigurationYes
--disk_size-dNode disk sizeYes

Example:

$ lbg node create -n dpgen -s c4_m8_cpu -d 100 -i 501 
# Create a node with the name dpgen, configuration 4 cores, 8GB memory, 100GB hard disk, and image id 501

Restart node: restart

Entrance:

lbg node restart [-h] node_id [node_id ...]

Summary:

usage: lbg node restart [-h] node_id [node_id ...]

positional arguments:
node_id id of the node

options:
-h, --help show this help message and exit

Parameter description:

ParameterAbbreviationDescriptionRequired
node_id-Node idYes

Example:

$ lbg node restart 54889 11037
# Start nodes 54889 and 11037

Pause node: stop

Entrance:

lbg node stop [-h] node_id [node_id ...]

Summary:

usage: lbg node stop [-h] [-f] node_id [node_id ...]

positional arguments:
node_id id of the node

options:
-h, --help show this help message and exit

Parameter description:

ParameterAbbreviationDescriptionRequired
node_id-Node idYes
--force-fDo not ask during pause processNo

Example:

$ lbg node stop 54889 11037
# Pause nodes 54889 and 11037

Remove node: rm

Entrance:

lbg node rm [-h] node_id [node_id ...]

Summary:

usage: lbg node rm [-h] [-f] node_id [node_id ...]

positional arguments:
node_id id of the node

options:
-h, --help show this help message and exit

Parameter description:

ParameterAbbreviationDescriptionRequired
node_id-Node idYes
--force-fDo not ask during removal processNo

Example:

$ lbg node rm 54889 11037
# Remove nodes 54889 and 11037

Convert node to snapshot: tosnap

Entrance:

lbg node tosnap [-h] [-c COMMENT] -i IMAGE_NAME -m NODE_ID

Summary:

usage: lbg node tosnap [-h] [-c COMMENT] -i IMAGE_NAME -m NODE_ID

options:
-h, --help show this help message and exit
-c COMMENT, --comment COMMENT
comment of image
-i IMAGE_NAME, --image_name IMAGE_NAME
name of the development image
-m NODE_ID, --node_id NODE_ID
id of the node

Parameter description:

ParameterAbbreviationDescriptionRequired
--comment-cSnapshot commentNo
--image_name-iSnapshot nameYes
--node_id-mNode idYes

Example:

$ lbg node tosnap -i "DPGEN-04" -m 11037 -c "dpgen backup in April"
# Convert node id 11037 to development image with comment "DPGEN-04" and name "dpgen backup in April"