查看所有vm和主机的对应关系主机后有vm台数------------------
for I in $(
cat <<eof | cat
PTtile
192.168.1.xxx pool只添加master就可以了
eof
);do
{
[ "$I" = "PTtile" ] && echo -e "Host and VMlist" || ssh $I "
for XX in \`xe host-list params=uuid --minimal | awk -F, ‘{for (i=1;i<=NF;i++) {printf \$i\"\n\"}}‘ |sort\`
do
#echo ===================================================
echo -n \`xe host-list uuid=\$XX params=name-label --minimal \`
echo -n ====hostname====VmNO:
xe vm-list resident-on=\$XX params=name-label --minimal | awk -F, ‘{printf NF-1\"\n\"}‘
xe vm-list resident-on=\$XX params=name-label --minimal | awk -F, ‘{for (i=1;i<=NF;i++) {printf \$i\"\n\"}}‘ |sort
done ;
";
}
done
本文出自 “11416160” 博客,谢绝转载!
原文地址:http://11426160.blog.51cto.com/11416160/1871245