Other articles


  1. Mount Ceph block disk of a server instance.

    Get the block device from vm

    root@overcloud-compute-01:~# virsh domblklist instance-00000001
    Target     Source
    ------------------------------------------------
    vda        compute/f0984ae9-f9c9-439b-80b9-f1c6201c914c_disk
    

    Shutdown the instance from OSP

    Map the disk using rbd command

    root@overcloud-compute-01:~# rbd map compute/f0984ae9-f9c9-439b-80b9-f1c6201c914c_disk --name client.admin
    

    Mount the disk

    root@overcloud-compute-01:~# mount /dev/rbd/compute/f0984ae9-f9c9-439b-80b9-f1c6201c914c_disk-part1 /mnt
    

    Do the changes …

    read more
  2. egrep Regex for filtering mac

    egrep Regex

    '([0-9a-f]{2}:){5}[0-9a-f]{2}'
    

    Example

    for i in $(virsh list |grep -v Name|awk '{print $2}' ) ; do 
       echo -e $i 
       virsh domiflist $i
    done | egrep '([0-9a-f]{2}:){5}[0-9a-f]{2}' | awk '{print $NF}'
    
    read more
  3. How to download images from OpenStack Glance.

    Here is the syntax to download images from OpenStack glance

    source overcloudrc
    openstack image save --file local-file-name.qcow2 image-name
    

    Or if you would like to compress the downloaded image on the fly

    source overcloudrc
    openstack image save image-name | gzip -c > local-file-name.raw.gz
    

    Example

    [stack@ospdir ~]$ source overcloudrc
    (admin@overcloud …
    read more

links

social