Difference between revisions of "Fuel CLI"
(Created page with "= Understanding Environment deployment with Fuel CLI = == Introduction == Fuel CLI tool is a powerful tool that allows you to: * Operate with environments using the text co...") |
Ogusarenko (talk | contribs) (→Configuring) |
||
(5 intermediate revisions by 4 users not shown) | |||
Line 18: | Line 18: | ||
''Example'': | ''Example'': | ||
− | <pre>fuel --env-id=1 node set --node-id=1,4,5 --role=controller | + | <pre>fuel --env-id=1 node set --node-id=1,4,5 --role=controller</pre> |
where <code>--env-id=1</code> is a global optional argument pointing to the specific environment, <code>node</code> - is a namespace for all node control functions, <code>set</code> is an action that assigns specific nodes to some environments in certain roles. | where <code>--env-id=1</code> is a global optional argument pointing to the specific environment, <code>node</code> - is a namespace for all node control functions, <code>set</code> is an action that assigns specific nodes to some environments in certain roles. | ||
Line 27: | Line 27: | ||
<pre>fuel <namespace> --help</pre> | <pre>fuel <namespace> --help</pre> | ||
+ | |||
== CLI commands reference == | == CLI commands reference == | ||
=== Release === | === Release === | ||
− | Get list of all | + | Get list of all available releases: |
<pre>fuel release</pre> | <pre>fuel release</pre> | ||
Line 41: | Line 42: | ||
<pre>fuel rel --rel 1</pre> | <pre>fuel rel --rel 1</pre> | ||
− | = Environment = | + | === Environment === |
To list environments: | To list environments: | ||
Line 49: | Line 50: | ||
<pre>fuel env create --name MyEnv --rel 1 </pre> | <pre>fuel env create --name MyEnv --rel 1 </pre> | ||
− | + | By default it creates environment in <code>multinode</code> mode, and <code>nova</code> network mode. | |
+ | To specify other modes, you can add optional arguments; for example: | ||
− | <pre>fuel env create --name MyEnv --rel 1 --mode ha --network-mode neutron</pre> | + | <pre>fuel env create --name MyEnv --rel 1 --mode ha --network-mode neutron --net-segment-type vlan</pre> |
− | + | Use the <code>set</code> action to change the name, mode, or network mode for the environment; for example: | |
<pre>fuel --env 1 env set --name NewEmvName --mode ha_compact</pre> | <pre>fuel --env 1 env set --name NewEmvName --mode ha_compact</pre> | ||
Line 58: | Line 60: | ||
<pre>fuel --env 1 env delete</pre> | <pre>fuel --env 1 env delete</pre> | ||
− | = Node = | + | |
+ | === Node === | ||
To list all available nodes run: | To list all available nodes run: | ||
Line 66: | Line 69: | ||
<pre>fuel --env-id 1 node list</pre> | <pre>fuel --env-id 1 node list</pre> | ||
− | Assign some nodes to | + | Assign some nodes to environment with with specific roles |
<pre>fuel node set --node 1 --role controller --env 1 | <pre>fuel node set --node 1 --role controller --env 1 | ||
Line 73: | Line 76: | ||
<pre>fuel node remove --node 2,3 --env 1</pre> | <pre>fuel node remove --node 2,3 --env 1</pre> | ||
− | Also you can do it without <code>--env</code> or <code>--node</code> to remove some nodes without knowing their environment and remove all nodes of some environment | + | Also you can do it without <code>--env</code> or <code>--node</code> to remove some nodes without knowing their environment and remove all nodes of some environment respectively. |
<pre>fuel node remove --node 2,3 | <pre>fuel node remove --node 2,3 | ||
fuel node remove --env 1</pre> | fuel node remove --env 1</pre> | ||
− | = Configuring = | + | === Configuring === |
Configuration of environment or some node is universal and done in three stages | Configuration of environment or some node is universal and done in three stages | ||
Line 99: | Line 102: | ||
<pre>fuel --env 1 provisioning upload | <pre>fuel --env 1 provisioning upload | ||
fuel node --node-id 2 --disk --upload</pre> | fuel node --node-id 2 --disk --upload</pre> | ||
− | |||
− | To protect yourself from sudden errors, please follow these simple rules: | + | '''note''': To protect yourself from sudden errors, please follow these simple rules: |
+ | * Back up all of your configuration before you begin any modifications. | ||
+ | * If you remove something from a configuration file, be sure you don't need it. Fuel CLI doesn't merge new data with the existing - it will overwrite the old data with the new. | ||
+ | * Keep in mind that if you upload any changes in provisioning or deployment operations, you will freeze the entire environment configuration - any changes with networks, cluster settings, or disk configurations won't take effect. In order to modify such parameters, you will need to change the appropriate section of each node configuration. | ||
− | + | === Deployment === | |
− | |||
− | |||
− | |||
− | = Deployment = | ||
− | Finally you can deploying | + | Finally you can deploying environment changes with |
<pre>fuel --env 1 deploy-changes</pre> | <pre>fuel --env 1 deploy-changes</pre> |
Latest revision as of 11:52, 20 January 2016
Contents
Understanding Environment deployment with Fuel CLI
Introduction
Fuel CLI tool is a powerful tool that allows you to:
- Operate with environments using the text console only.
- Modify directly the internal data that you can't modify via the web UI.
- Avoid data verifications done by the web UI logic.
Fuel CLI may break your environment if not used carefully.
Basic usage
Fuel CLI has the following usage pattern:
fuel [global optional args] <namespace> [action] <optional args>
Example:
fuel --env-id=1 node set --node-id=1,4,5 --role=controller
where --env-id=1
is a global optional argument pointing to the specific environment, node
- is a namespace for all node control functions, set
is an action that assigns specific nodes to some environments in certain roles.
for getting list of all global optional args and namespaces you can run: :
fuel --help
and for getting actions and optional args for some namespace run: :
fuel <namespace> --help
CLI commands reference
Release
Get list of all available releases:
fuel release
or short version
fuel rel
for specific release
fuel rel --rel 1
Environment
To list environments:
fuel env
To create an environment, run:
fuel env create --name MyEnv --rel 1
By default it creates environment in multinode
mode, and nova
network mode.
To specify other modes, you can add optional arguments; for example:
fuel env create --name MyEnv --rel 1 --mode ha --network-mode neutron --net-segment-type vlan
Use the set
action to change the name, mode, or network mode for the environment; for example:
fuel --env 1 env set --name NewEmvName --mode ha_compact
To delete the environment:
fuel --env 1 env delete
Node
To list all available nodes run:
fuel node list
and filter them by environment
fuel --env-id 1 node list
Assign some nodes to environment with with specific roles
fuel node set --node 1 --role controller --env 1 fuel node set --node 2,3,4 --role compute,cinder --env 1
Remove some nodes from environment
fuel node remove --node 2,3 --env 1
Also you can do it without --env
or --node
to remove some nodes without knowing their environment and remove all nodes of some environment respectively.
fuel node remove --node 2,3 fuel node remove --env 1
Configuring
Configuration of environment or some node is universal and done in three stages
- Download current or default configuration. works for (
network
,settings
,node --disk
,node --network
). Operations withdeployment
andprovisioning
can be node specific. (e.g.fuel --env 1 deployment --node-id=1,2
)
Example:
fuel --env 1 network download fuel --env 1 settings download fuel --env 1 deployment default fuel --env 1 provisioning download fuel node --node-id 2 --disk --download
- Add to downloaded files or edit them with your favorite text editor.
- Upload files to nailgun server
Example:
fuel --env 1 provisioning upload fuel node --node-id 2 --disk --upload
note: To protect yourself from sudden errors, please follow these simple rules: * Back up all of your configuration before you begin any modifications. * If you remove something from a configuration file, be sure you don't need it. Fuel CLI doesn't merge new data with the existing - it will overwrite the old data with the new. * Keep in mind that if you upload any changes in provisioning or deployment operations, you will freeze the entire environment configuration - any changes with networks, cluster settings, or disk configurations won't take effect. In order to modify such parameters, you will need to change the appropriate section of each node configuration.
Deployment
Finally you can deploying environment changes with
fuel --env 1 deploy-changes
Also, you can deploy and provision only some nodes like this
fuel --env 1 node --provision --node 1,2 fuel --env 1 node --deploy --node 1,2