가상화 & 클라우드
Citrix XenServer Pool 내 VM 현황 출력
snoopybox
2012. 10. 20. 01:58
회사에서 업무상 필요해서 만들어 두었는데, 정리 차원에서 올려둡니다.
## HOST VM CPU MEMORY(MB) 순서로 출력 ##
for a in `xe host-list params=name-label --minimal | sed 's/,/\n/g' | sort`; do
huuid=`xe host-list name-label=$a --minimal`
for b in `xe vm-list is-control-domain=false resident-on=$huuid --minimal | sed 's/,/ /g'`; do
vname=`xe vm-list uuid=$b params=name-label --minimal`
vcpu=`xe vm-list uuid=$b params=VCPUs-number --minimal`
vmemory=$[`xe vm-list uuid=$b params=memory-static-max --minimal` / 1048576]
echo -e "$a\\t$vname\\t$vcpu\\t$vmemory"
done | sort
done
Pool 내에 VM이 어디 들어있는지 자료를 현행화 해서 관리해야 한다면 유용하게 쓰일 겁니다.
## HOST VM CPU MEMORY(MB) 순서로 출력 ##
for a in `xe host-list params=name-label --minimal | sed 's/,/\n/g' | sort`; do
huuid=`xe host-list name-label=$a --minimal`
for b in `xe vm-list is-control-domain=false resident-on=$huuid --minimal | sed 's/,/ /g'`; do
vname=`xe vm-list uuid=$b params=name-label --minimal`
vcpu=`xe vm-list uuid=$b params=VCPUs-number --minimal`
vmemory=$[`xe vm-list uuid=$b params=memory-static-max --minimal` / 1048576]
echo -e "$a\\t$vname\\t$vcpu\\t$vmemory"
done | sort
done
Pool 내에 VM이 어디 들어있는지 자료를 현행화 해서 관리해야 한다면 유용하게 쓰일 겁니다.