Skip to content

Instantly share code, notes, and snippets.

Erwan Velu ErwanAliasr1

  • Criteo
  • Paris
Block or report user

Report or block ErwanAliasr1

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View plop.sh
erwan@R1:~/Devel/ceph-container (evelu-pointrelease)$ diff -ub tests/stage-test/stage-key/files-sources tests/stage-test/staging/luminous-ubuntu-16.04-x86_64/files-sources
--- tests/stage-test/stage-key/files-sources 2018-04-03 20:31:12.238872844 +0200
+++ tests/stage-test/staging/luminous-ubuntu-16.04-x86_64/files-sources 2018-04-03 20:57:16.162802869 +0200
@@ -7,8 +7,8 @@
daemon-base/__EMPTY__ <- tests/stage-test/src/daemon-base/__EMPTY__
daemon-base/__H4X0R__ <- tests/stage-test/src/daemon-base/__H4X0R__
daemon-base/src-daemon-base-test-file <- tests/stage-test/src/daemon-base/src-daemon-base-test-file
-daemon-base/ubuntu-mimic-override <- tests/stage-test/ceph-releases/luminous/ubuntu/16.04/ubuntu-mimic-override
daemon-base/__OS_CODENAME__
View pwet.sh
function run_tox {
case "$CEPH_ANSIBLE_BRANCH" in
stable-*)
CEPH_DOCKER_IMAGE_TAG=$(find_latest_tag $RELEASE)
;;
master)
CEPH_DOCKER_IMAGE_TAG="latest"
;;
*)
CEPH_DOCKER_IMAGE_TAG=""
View Readme.MD

Selecting disks to be used by Ceph-Ansible

Why do we need a module for selecting disks ?

The legacy approach to select disks on a set of servers is to use their logical names like "/dev/sdx".

Using a logical name to point a device have the following drawbacks:

  • the device path is not consistent over time : {add|remov}ing devices change the name
View zou
TASK [debug] *******************************************************************
ok: [localhost] => {
"devices": {
"storage_disks_000_000": {
"bdev": "/dev/disk/by-id/scsi-36848f690e68a50001e428e4f1e211ba2",
"holders": [],
"host": "RAID bus controller: LSI Logic / Symbios Logic MegaRAID SAS 2208 [Thunderbolt] (rev 01)",
"model": "PERC H710P",
"partitions": {},
"removable": "0",
View plop.yml
---
# Defines deployment design and assigns role to server groups
- hosts: localhost
gather_facts: false
vars:
lookup_disks: "{'storage_disks': {'size': 'gt(800 MB)', 'rotational': '1', 'count' : '*'}}"
tasks:
# If we can't get python2 installed before any module is used we will fail
# so just try what we can to get it installed
View plop.py
def get_scratch_devices2(remote):
"""
Extract the list of free block device from a host
"""
used_block_devices = get_used_block_devices(remote)
used_block_devices.append(get_root_device(remote))
translated_uuids = translate_block_UUID(used_block_devices)
expanded_block_devices = expand_dm_devices(translated_uuids)
translated_block_devices = translate_block_devices_path(expanded_block_devices)
final_used_block_devices = partitions_to_block_device(translated_block_devices)
View test.sh
#!/bin/bash
function run_in_background() {
# The first argument is the name of the PID variable
# We execute everything passed in argument
# And save the running pid in the variable name
local pid_variable=$1
shift;
"$@" & eval "$pid_variable+=\" $!\""
}
View plop.sh
#!/bin/bash
pids=""
(sleep 10; exit 10) & pids="$pids $!"
(sleep 5; exit 5) & pids="$pids $!"
pids="$pids 9999"
for pid in $pids; do
wait $pid
View plop.diff
diff --git a/src/ceph-disk/tests/test_main.py b/src/ceph-disk/tests/test_main.py
index fe85eb7..47b74ae 100644
--- a/src/ceph-disk/tests/test_main.py
+++ b/src/ceph-disk/tests/test_main.py
@@ -315,7 +315,7 @@ class TestCephDisk(object):
partition_uuid = "56244cf5-83ef-4984-888a-2d8b8e0e04b2"
disk = "Xda"
partition = "Xda1"
- holders = ["dm-0"]
+ holders = ["dm-100"]
You can’t perform that action at this time.