You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Ceph

Skru av reabalansering av OSDer

Dette er nyttig hvis man skal ha planlagt vedlikehold av en ceph-server. Det sørger for at ceph IKKE rebalanserer data når man skrur av en ceph-boks (det skaper veldig mye trafikk).

Gjøres på en ceph-mon host

ceph osd set noout

Etter utført vedlikehold, må man skru på igjen rebalanseringen

ceph osd unset noout

 

Foreman

Liste alle interfjes

hammer host interface list --host <hostname>
hammer host interface list --host compute06.skyhigh

Slette interfjes

hammer host interface delete --id <interface-id> --host <hostname>

Interface-id blir listet ut av liste-kommandoen. Da kan man f.eks gjøre smarte ting som:

hammer host interface list --host compute05.skyhigh | egrep 'qv|qbr|tap|virbr|ovs|qg|qr|ha' | awk '{print $1}'  > delete.txt

og 

for i in $(cat delete.txt); do hammer host interface delete --id $i --host compute05.skyhigh; done

Openstack

List instances on all compute nodes on stack.it.ntnu.no

tmp_file=/tmp/$$.stack.tmp
while true ; do
  rm /tmp/*.stack.tmp
  for a in $(seq -w 01 07);
    do echo compute$a  >> $tmp_file
    openstack server list --all --host compute$a >> $tmp_file
  done
  clear
  cat /tmp/bjarneskvms
  rm $tmp_file
  sleep 1
done

List all instances in a project

openstack server list --project ntnu-00001

List all instances in a project with specified name

openstack server list --project ntnu-00001 --name bjarneskvm-\*

Migrate all instances away from one node. Be sure that destination have capasity to receive. The break time is included for a safe time to hold ctrl+c

from_node=compute07
to_node=compute04
for a in $(openstack server list --host $from_node --all -f value -c ID); do 
  do echo $a to $to_node
  openstack server migrate --block-migration --live $to_node --wait $a
  echo break
  sleep 3
  echo break
done

 

 

 

  • No labels