calamari:add the cache pool restful api for calamari#418
calamari:add the cache pool restful api for calamari#418songbaisen wants to merge 1 commit intoceph:masterfrom
Conversation
Signed-off-by: song baisen <song.baisen@zte.com.cn>
|
The cache pool is very useful in ceph.So we need to add the rest api for user to use. And right now only pull the code. If no body have doubt about this pr.later on i will add unit test and update the doc. |
| pool_name = self._resolve_pool(pool_id)['pool_name'] | ||
| cache_mode = self._resolve_pool(pool_id)['cache_mode'] | ||
| commands = [] | ||
| if cache_mode == "write_back": |
There was a problem hiding this comment.
@songbaisen This seems like we're ignoring a step where we should empty the write-back pool first. See http://docs.ceph.com/docs/master/dev/cache-pool/#interface under "Drain the cache in preparation for turning it off:" What do you think we could do to make this more correct?
There was a problem hiding this comment.
@GregMeno HI, thank you for your review and good advise.I think if the cache mode is write-back,Here we need to drain all the data from "cachepool" to "basepool" use the below command. After that we can remove the cache tier between the "cachepool" and "basepool".
ceph osd tier cache-mode "cachepool" forward
rados -p "cachepool" cache-flush-evict-all
To check the above operation finish .We can wait for the osdmap and check whether the "cachepool" already remove the tier relation by the "tier_of" is equal to -1.How do you think about this?
There was a problem hiding this comment.
@GregMeno And here except writeback mode the read-forward and read-proxy also need to do the same operation drain the cache pool before turning it off.
calamari:add the cache pool restful api for calamari
Signed-off-by: song baisen song.baisen@zte.com.cn