how to create a cluster of heterogenous (in terms of flavor, disk, configuration, region, type, etc.) instances via the python-troveclient.
$ trove help create-cluster
usage: trove create-cluster <name> <cluster_size> <datastore> <datastore_version> <flavor_id> <disk_size>
[--configuration <configuration>]
Creates a new cluster.
Positional arguments:
<name> Name of the cluster
<cluster_size> Size of the cluster (number of instances)
<datastore> A datastore name or UUID
<datastore_version> A datastore version name or UUID
<flavor_id> Flavor of the instance.
<disk_size> Size of the instance disk in GB
Optional arguments:
--configuration <configuration>
UUID of the configuration group to attach to the
instance.
$ trove create-cluster products 3 mongodb "2.4.10" 12 50 --configuration 1-2-3-4
Option #1: Inlining Differing Instances
$ trove create-cluster products 3 mongodb "2.4.10" 12 50 --configuration 1-2-3-4
--instances '[{"flavorRef": "7",
"volume": {"size": 1},
"configuration": "b9c8a3f8-7ace-4aea-9908-7b555586d7b6",
"type": "arbiter"},
{"flavorRef": "7",
"volume": {"size": 1},
"configuration": "b9c8a3f8-7ace-4aea-9908-7b555586d7b6",
"type": "arbiter"}
]'
The above would create 3 nodes with flavor=12, disk-size=50, config=1-2-3-4, and 2 nodes with flavor=7, disk-size=1, type=arbiter (a cluster of 5)
Option #2: ?
- Do any of the other python clients support providing a raw json request, and/or is there an example of an openstack project issuing raw json requests? If so, perhaps the official python client can officially support homogenous clusters, but horizon and others provide the raw request to the client (or curl it).
Heterogenous Options
example: three members in west, 2 secondaries in east, with two arbiters in eu
option #1: non-uniform --instances with json array
Notes:
option #2: non-uniform instances, repeatable --instance flag
option #3: non-uniform instances with block-device-mapping-style colons, repeatable --instance flag
option #4: all instances with block-device-mapping-style colons, repeatable --instance flag
Notes:
option 5: all instances with block-device-mapping-style colons, but with labels, repeatable --instance flag
Notes:
option #6: all instances with json format, repeatable --instance flag
option #7: comma separated per field
option #8: repeatable positional
Notes: