Use the viocli swift command to manage Swift clusters and nodes in your OpenStack deployment.

The viocli swift command supports a variety of actions to perform different tasks. The following parameters apply to all actions.

Parameter Mandatory or Optional Description

-d NAME or --deployment NAME

Optional

Name of the deployment to use.

If you do not enter a value, the default deployment is used.

-p or --progress

Optional

Shows the progress of the current operation.

--verbose

Optional

Displays output in verbose mode.

You can run viocli swift -h or viocli swift --help to display the parameters for the command. You can also use the -h or --help option on any action to display parameters for the action. For example, viocli swift create-cluster -h will show parameters for the create-cluster action.

The actions that viocli swift supports are listed as follows.

viocli swift create-cluster [-d NAME] --cluster-moid MOID --datastores DS1[,DS2...] [--storage-node-count STORAGE-NODES] [--proxy-node-count PROXY-NODES] [--disk-size GB] [--swift-partition-power-count PARTITION-POWER] [--swift-replica-count REPLICAS] [--swift-min-part-hours HOURS] [-f SPEC-FILE] [-p] [--verbose]

Creates a Swift cluster. The following additional parameters apply to the create-cluster action.

Parameter Mandatory or Optional Description

--cluster-moid

Mandatory unless -f is used.

Managed object ID (MOID) of the vSphere cluster.

--datastores

Mandatory unless -f is used.

Datastores to use for Swift storage nodes, separated with commas.

Important: Swift does not support datastore clusters.

--storage-node-count

Optional

Number of Swift storage nodes to create.

If you do not enter a value, 3 is used by default.

--proxy-node-count

Optional

Number of Swift proxy nodes to create.

If you do not enter a value, 2 is used by default.

--disk-size

Optional

Disk size in gigabytes for Swift storage nodes.

If you do not enter a value, 2048 is used by default.

--swift-partition-power-count

Optional

Partition power of the Swift ring. The number of partitions managed by the ring is equal to 2 raised to the partition power.

If you do not enter a value, 10 is used by default.

--swift-replica-count

Optional

Number of replicas to create for objects stored in Swift.

If you do not enter a value, 3 is used by default.

Note: The number of replicas cannot exceed the number of storage nodes in the deployment.

--swift-min-part-hours

Optional

Time in hours before a partition can be assigned to another storage node.

If you do not enter a value, 1 is used by default.

-f or --json-file

Optional

JSON file containing the parameters to create the Swift cluster.

The format of the JSON file is as follows:

{
        "cluster_moid": "moid",
        "storage_node_number": storage-nodes,
        "proxy_node_number": proxy-nodes,
        "ring_settings": {
                "swift_replica_count": replicas,
                "swift_min_part_hours": hours,
                "swift_partition_power_count": power
        },
        "storage_settings": [
                {
                        "datastore_name": "ds1",
                        "zone_number": ds1-zone,
                        "disk_size": ds1-disk-gb
                }
        ]
}

Create a copy of the contents of the storage_settings section for each storage node that you want to create.

If you do not use a JSON file to create your cluster, zone numbers are assigned to the specified datastores in order. You can use the zone_number parameter in the JSON file to assign specific zone numbers or to place multiple datastores in the same zone. A single datastore cannot be placed in multiple zones.

 

viocli swift delete-cluster [-d NAME] [-f] [-p] [--verbose]

Deletes the Swift cluster.

Parameter Mandatory or Optional Description

-f or --force

Optional

Deletes the cluster without prompting for confirmation.

 

viocli swift add-storage [-d NAME] --datastores DS1[,DS2...] [--storage-node-count STORAGE-NODES] [--disk-size GB] [-f SPEC-FILE] [-p] [--verbose]

Adds storage nodes to an existing Swift cluster.

Parameter Mandatory or Optional Description

--datastores

Mandatory unless -f is used.

Datastores to use for the new Swift storage nodes, separated with commas.

Important: Swift does not support datastore clusters.

--storage-node-count

Optional

Number of Swift storage nodes to add.

If you do not enter a value, 1 is used by default.

--disk-size

Optional

Disk size in gigabytes for the new Swift storage nodes.

If you do not enter a value, 2048 is used by default.

-f or --json-file

Optional

JSON file containing the parameters to create the storage nodes.

The format of the JSON file is as follows:

{
        "storage_node_number": nodes,
        "storage_settings": [
                {
                        "datastore_name": "ds1",
                        "zone_number": ds1-zone,
                        "disk_size": ds1-disk-gb
                }
        ]
}

Create a copy of the contents of the storage_settings section for each storage node that you want to create.

If you do not use a JSON file to add storage nodes, zone numbers are assigned to the specified datastores in order. You can use the zone_number parameter in the JSON file to assign specific zone numbers or to place multiple datastores in the same zone. A single datastore cannot be placed in multiple zones.

 

viocli swift add-proxy [-d NAME] [--proxy-node-count PROXY-NODES] [-p] [--verbose]

Adds proxy nodes to an existing Swift cluster.

Parameter Mandatory or Optional Description

--proxy-node-count

Optional

Number of Swift proxy nodes to add.

If you do not enter a value, 1 is used by default.

 

viocli swift list-datastore-zone-mapping [-d NAME] [-p] [--verbose]

Displays all datastores and the zones in which they are located.