This charm will import glance images from a master openstack installations.
It will copy image files and metadata with rsync over ssh to local disk and import into glance from there.
The glance-sync-slave charm pulls glance images and metadata from a master openstack
installation. It copies them to local disk using rsync over ssh and imports them into
local glance from there.
The master has a list of command-limited authorized keys (juju config option) where slaves can be authorized.
Your slave unit will need to be subscribed there.
Slave units regularly pull images from the master unit using rsync, the metadata that is rsynced as a separate json file contains the md5 checksum which the slave verifies before importing into their local glance store.
Image IDs are preserved across locations, this means no glance images should be created in a slave location to avoid ID conflicts.
One thing to note is that glance (by default) does not delete images. If you glance image-delete it will be removed from an image-list but not actually deleted from the database. A subsequent image-create with the same ID will lead to a conflict.
If an image is deleted from the masters glance instance, it will also be deleted from the local rsync directory which will propagate out to the slaves filesystem. But the slaves are currently not deleting images from their local glance stores.
Context: Should a glance image accidentally get deleted from the master glance instance and subsequently from the slave, there would be no way to add the image back (with the same image ID) without manual DB surgery on both the slave and the master. We avoid this by not deleting images from slave glance instances as mentioned.
Both the i-age--ync-master and glance-sync-slave units can pull admin credentials from their local glance instances through a keystone-admin relation. This can be overridden with a custom novarc that can be set through a base64-encoded juju config setting. If a pre-existing custom novarc is removed the charm will fall back to using the relation and will display an error in juju status if neither are available.
juju deploy glance-sync-slave
juju set glance-sync-slave sync_source=:
juju set sync_enabled=True