swift 2.10.0 was released in 2016. We no longer need to support even
older versions. The output format depends on the version currently
installed, thus the latest logic should work as long as the same
release (or even a bit older release) is installed.
This also updates the logic to skip the header lines. The new logic
is considered to be more robust, because it works even when additional
lines are added.
Change-Id: I694ca4c046f490e4ffecf2101f3f147a69045162
This change ensures the shortened address representations are always
used for ring devices to avoid broken idempotency caused by different
representations (shortened[1] vs canonical[2]).
[1] ::1
[2] 0000:0000:0000:0000:0000:0000:0000:0001
Closes-Bug: #1997313
Change-Id: I762f0780ba25536aa616482a49d59c7db69924d6
The change 63688a14e57282ae97072b406c81d0da2f61965c introduced support
of storage policies and since the change was merged builder_file_path
takes one argument which is policy_index .
This change fixes the function call without argument to avoid failure
caused by missing argument.
Closes-Bug: #1949334
Change-Id: I987a37cb0606b6c217f906fbae17a765e40f4580
Updating region/zone of a device is actually implemented and supported
in swift, while puppet-swift doesn't support that operation yet.
This patch updates error messages when an operator tries to update
region/zone of a device, so that they notice more clearly that the
cause exists in puppet-swift, not in swift.
Change-Id: I7c7f633630ac52578a0cf6beb2033465a16bd251
This change implements storage policies as defined by swift:
http://docs.openstack.org/developer/swift/overview_policies.html
There are two primary areas of change in this review
- Add storage policy support to the ringbuilder and ring devices, along with
associated spec tests.
- Adding storage policy support and enforcing rules in swift.conf using the
swift_storage_policy type and provider. Also: updated spec tests and an
update to swift acceptance test to use storage policies to configure an
additional 3 replica based ring.
See release notes and the README update for more details/instructions.
Change-Id: I2b8db751790704df3f1027a14f61e231591537f3
This patch: https://review.openstack.org/#/c/319387
modified the output of rings, so we need to add the case where this
regex is found and how to use it.
Change-Id: Id9f1a478670e7b618ce9d222c5bc9739e3dd6286
If a ring is balanced or does not need an update, swift-ring-builder
will print an additional line:
"Ring file /etc/swift/container.ring.gz is up-to-date"
Skip this line in parsing the output to avoid "Warning: Unexpected line:"
Change-Id: Ibc021f62f699c94f36c76b11acefe1000f6a2288
Starting in swift 2.2.2 an extra line for overload is printed
by swift-ring-builder.
Check for this and skip that line to avoid avoid warning messages.
Change-Id: I2d81db0a29249101116c1899565f024aaac69000
Closes-Bug: #1524936
One shold never parse uri with split(':') as it was in types
ring_account_device, ring_container_device and ring_object_device.
This is fixed by using uri and just setting variables from that.
Also swift_ring_builder didn't add brackets to ipv6 address before
adding port information to it.
Change-Id: I55b7032143c8446abeed4f6c266c0fff0cb6b3b3
Since Swift 1.8.0, there is the region layer of topology above zones.
swift-ring-builder supports this natively and this commit allows a user to
specify a region when creating devices.
We maintain backwards compatibility by defaulting to region '1'.
The coverage of the ring builder spec tests were also improved as part of
this commit.
Change-Id: I67cbe6b87c84778f71df59cf00f2c5175342bc1b
Updates swift_ring_builder rebalancing parsing to support the
latest upstream replicator_id and replicator_port changes.
This correspondes with swift 1.8+ upstream development.
Fixes LP Bug #1182197.
Change-Id: Ibbaf75ca22cad95b22f9b5f03b547db8c47a9ea4
In some case, there are no spaces before - of the balance in swift 1.8.
The change fix this.
/etc/swift/object.builder, build version 9
32768 partitions, 3.000000 replicas, 1 regions, 3 zones, 9 devices, 200.00 balance
The minimum number of hours before a partition can be reassigned is 24
Devices: id region zone ip address port name weight partitions balance meta
0 1 1 10.68.0.45 6000 sdd 100.00 32768 200.00
1 1 2 10.68.0.46 6000 sdd 100.00 0-100.00
...
Change-Id: Ic7757a22ce94e4d51ae11780d4626c90a9ed430f
Updates the swift_ring_builder so that it parses ring builder output
from the most recent Swift releases correctly (1.7.6 or greated).
Backward compat for the previous parsing is still supported.
Change-Id: I4263b349310e16f6825960805eb27e4bfe3ff002
Previously, the Puppet modules only supported a single device per
endpoint.
This commits allows multiple devices per endpoint by making the device
name a part of the namevar for the swift ring devices.
it also updates the relevent configs.
Previously, the swift caches were being built on the class
instances themselves.
This could result in stale values when puppet runs multiple times
using the same process (like in the case of puppet agent)
This commit uses prefetch to ensure that the retrieved swift ring
values are updated per puppet run.
The code was not robust when no
rows were returned from
swift_ringbuilder(builder_file_path).
The calls to retrieve an array range from the
array of this commands output was returning nil
which caused the failure: undef method each on nil
This change explicitly checks for the case where
there are no rows returned by swift-ring-builder.
This commit adds a class, defined resources and
native types that can be used together to manage
the creation, configuration, and rebalancing of
rings.
Creates the following native types:
ring_account_device
ring_container_device
ring_object_device
The implementation of these types is provided
by swift-ring-builder and most of the functionality
is provided by the parent provider (SwiftRingBuilder)
Each of the providers is hard-coded to find the
relevent ring database in /etc/swift. This directory
location can currently not be configured.
Each provider implements self.instances so the
current state can of the ring can be queried from
puppet.
These providers do not handle either the creation
or the rebalancing of the rings, they are intended
to be used in combination with defined resource types
that perform that functionality:
swift::ringbuilder::create
swift::ringbuilder::rebalance
The swift::ringbuilder class is also created as
a part of this commit. This class does the following:
- creates object, account, and container rings
(it uses the same parameters to create these rings)
- creates the rebalance defines
- sets up the following relationships:
for each ring type, create should be applied before
the native types which should refresh the rebalance