이 페이지의 이전 버전을 보고 있습니다. 현재 버전 보기.
현재와 비교
페이지 이력 보기
버전 1
현재 »
STOR=/rhev/data-center/mnt/glusterSD/n1.ovirt1.int:_vmstore01
PASS_VM=pass_vm.txt
PASS_HOST=$(cat pass_host.txt)
function CUSTOM_IMG(){
STOR=$1; ID=$2; PASS_HOST=$3; PASS_VM=$4;
IMG=$(find $STOR -type f | grep $ID | grep -vE 'meta|lease')
expect <<EOF
set timeout 3
spawn virt-customize -a $IMG --root-password file:$PASS_VM --copy-in /oh-my-zsh:/
expect "Please enter your authentication name:"
send "root\r"
expect "Please enter your password:"
send "$PASS_HOST\r"
expect eof
EOF
echo $ID
}
function SYSPREP_IMG(){
STOR=$1; ID=$2; PASS_HOST=$3;
IMG=$(find $STOR -type f | grep $ID | grep -vE 'meta|lease')
expect <<EOF
set timeout 3
virt-sysprep -a $IMG --operations defaults,-package-manager-cache,-ssh-userdir
expect "Please enter your authentication name:"
send "root\r"
expect "Please enter your password:"
send "$PASS_HOST\r"
expect eof
EOF
echo $ID
}