查看所有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
时间: 2024-10-10 11:46:37