[ClusterLabs] Antw: Coming in Pacemaker 1.1.17: container bundles

Ken Gaillot kgaillot at redhat.com
Mon Apr 3 10:47:33 EDT 2017

On 04/03/2017 02:12 AM, Ulrich Windl wrote:
>>>> Ken Gaillot <kgaillot at redhat.com> schrieb am 01.04.2017 um 00:43 in Nachricht
> <981d420d-73b2-3f24-a67c-e9c66dafb48f at redhat.com>:
> [...]
>> Pacemaker 1.1.17 introduces a new type of resource: the "bundle". A
>> bundle is a single resource specifying the Docker settings, networking
>> requirements, and storage requirements for any number of containers
>> generated from the same Docker image.
> I wonder: Is a "bundle" just a kind of special "group template"? It looks as if I could do it with a group also, but would have to write a bite more to get it configured. Did I miss something?

With a group, you could reproduce most of this functionality, though it
would be more verbose: you'd need to configure ocf:heartbeat:docker,
ocf:heartbeat:IPaddr2, and ocf:pacemaker:remote resources, plus a
primitive for your service, as well as constraints that restrict the
primitive to the guest node and prevent any other resource from running
on the guest node.

However, this can do something that a group can't: launch multiple
instances of a single container image, while associating floating IPs
and storage mappings specific to each replica. This puts it somewhere
between a group and a specialized form of clone.

Also, it will be shown differently in the cluster status, which is helpful.

> (With my background of HP-UX ServiceGuard, the "bundles remind me of  ServiceGuard's "packages" (easy to use, but less flexible than primitives/groups)
> Regards,
> Ulrich
>> A preliminary implementation of the feature is now available in the
>> master branch, for anyone who wants to experiment. The documentation
>> source in the master branch has been updated, though the online
>> documentation on clusterlabs.org has not been regenerated yet.
>> Here's an example of the CIB XML syntax (higher-level tools will likely
>> provide a more convenient interface):
>>  <bundle id="httpd-bundle">
>>   <docker image="pcmk:httpd" replicas="3" />
>>   <network ip-range-start="" host-netmask="24">
>>     <port-mapping id="httpd-port" port="80"/>
>>   </network>
>>   <storage>
>>     <storage-mapping id="httpd-root"
>>       source-dir="/srv/www"
>>       target-dir="/var/www/html"
>>       options="rw"/>
>>     <storage-mapping id="httpd-logs"
>>       source-dir-root="/var/log/pacemaker/bundles"
>>       target-dir="/etc/httpd/logs"
>>       options="rw"/>
>>   </storage>
>>   <primitive id="httpd-apache"
>>     class="ocf" provider="heartbeat" type="apache"/>
>>  </bundle>
>> With that, Pacemaker would launch 3 instances of the container image,
>> assign an IP address to each where it could be reached on port 80 from
>> the host's network, map host directories into the container, and use
>> Pacemaker Remote to manage the apache resource inside the container.
>> The feature is currently experimental and will likely get significant
>> bugfixes throughout the coming release cycle, but the syntax is stable
>> and likely what will be released.
>> I intend to add a more detailed walk-through example to the ClusterLabs
>> wiki.
>> -- 
>> Ken Gaillot <kgaillot at redhat.com>

More information about the Users mailing list