Add a new convenience method to ImageCtx for handling flush
requests and cleanup flush handling with dealing with the cache.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Ensure all AIO to the parent image is properly flushed and assert
that all work queues are empty before closing the parent image.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
If another (independent) queue was processing, drain could
block waiting. Instead, allow drain to exit quickly if
no items are being processed and the queue is empty for
the current WQ.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
ceph-disk: Add destroy and deactivate option
ceph-disk now understands deactivate to shutdown an OSD and umount the partition. It will remain in a "down" state until it is activated again with --reactivate. If a deactivated OSD is destroyed with ceph-disk destroy, it will be permanently removed from the cluster and from the crushmap.
Reviewed-by: Loic Dachary <ldachary@redhat.com>
- rework the unit test to coverage all deactivate/destroy function
- make test item simple and easier to read
Signed-off-by: Vicente Cheng <freeze.bilsted@gmail.com>
- Make code path much easier to get device info. (get little bit overhead)
- Let some error rasie the correct execption
- for dmcrypt device, we unmap on the deactivate stage. (consist with activate)
Signed-off-by: Vicente Cheng <freeze.bilsted@gmail.com>
- using the deactivate/destroy feature to destroy osd
- test reactivate option when the osd goes deactive
- add check_osd_status to check osd status when osd goes up
Signed-off-by: Vicente Cheng <freeze.bilsted@gmail.com>
- modify the behavior to handle dmcrypt/mpath osd
- add some functions to get the information of dmcrypt osd
- fixed the logging format Use `%(filename)s` instead of `%(filename)`
Signed-off-by: Vicente Cheng <freeze.bilsted@gmail.com>
- Add some unit test to coverage all destroy/deactivate feature.
- Do some minor modifications on the ceph-diskw
Signed-off-by: Vicente Cheng <freeze.bilsted@gmail.com>
- add `--reactivate` option (activate do no-op without reactivate with deactive flag)
- for consistency, make both deactivate and destroy take the device/partition name
- add `--deactivate-by-id` to deactivate and destroy for ease of use
Signed-off-by: Vicente Cheng <freeze.bilsted@gmail.com>
- Using `--mark-out` option to mark osd out when
deactivate this osd instead of always mark osd out.
Signed-off-by: Vicente Cheng <freeze.bilsted@gmail.com>
Implement deactivate option on ceph-disk.
- stop ceph-osd service if needed (If osd still in osd map, make it out first)
- remove 'ready', 'active', and INIT-specific files
- remove gpt partition type and change partition name (prevent triggered by udev)
- create deactive flag
- umount device and remove mount point
Signed-off-by: Vicente Cheng <freeze.bilsted@gmail.com>
--user is the equivalent of --id (mentioned in docs and ceph -h) and
used by at least a couple of qa scripts and teuthology. Add it to the
list of valid rbd options - it's handled inside global_init() before
Shell:execute() is called.
OTOH allowing -i is bogus - global_init() wouldn't process it for
clients (CEPH_ENTITY_TYPE_CLIENT), which rbd tool is one of. Drop it.
Signed-off-by: Ilya Dryomov <idryomov@redhat.com>
Now that the tests at the top level directory are run via TESTS and not
check-local:, the test-suite.log file is created and must bit
gitignored.
Signed-off-by: Loic Dachary <loic@dachary.org>
Previously, if snapname wasn't specified we would pass NULL to
krbd_map(), which was a cue for it to use "-" as a snapshot name. With
the new rbd CLI, "" is passed in; same goes for map options.
Change krbd_map() accordingly and update its other user.
Signed-off-by: Ilya Dryomov <idryomov@redhat.com>