Skip to content

Instantly share code, notes, and snippets.

View ErwanAliasr1's full-sized avatar

Erwan Velu ErwanAliasr1

View GitHub Profile
[erwan@7950 avx-turbo]$ ./avx-turbo
CPUID highest leaf : [10h]
Running as root : [NO ]
MSR reads supported : [NO ]
CPU pinning enabled : [YES]
CPU supports zeroupper: [YES]
CPU supports AVX2 : [YES]
CPU supports AVX-512F : [YES]
CPU supports AVX-512VL: [YES]
CPU supports AVX-512BW: [YES]
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__
@ErwanAliasr1
ErwanAliasr1 / pwet.sh
Last active March 16, 2018 11:56
pwet
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=""
plopplup
plou
lao

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
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",
---
# 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
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)
#!/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+=\" $!\""
}
#!/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