[kvm]: add debug cmd for build_kvm_image.sh (#6472)
dump netstat info on error Signed-off-by: Guohan Lu <lguohan@gmail.com>
This commit is contained in:
parent
ece8297cf8
commit
9b2bc880de
@ -22,6 +22,7 @@ on_exit()
|
||||
|
||||
on_error()
|
||||
{
|
||||
netstat -antp
|
||||
echo "============= kvm_log =============="
|
||||
cat $kvm_log
|
||||
}
|
||||
@ -51,12 +52,12 @@ create_disk
|
||||
prepare_installer_disk
|
||||
|
||||
echo "Prepare memory for KVM build: $vs_build_prepare_mem"
|
||||
sudo mount proc /proc -t proc || true
|
||||
mount proc /proc -t proc || true
|
||||
free -m
|
||||
if [[ "$vs_build_prepare_mem" == "yes" ]]; then
|
||||
# Force o.s. to drop cache and compact memory so that KVM can get 2G memory
|
||||
sudo bash -c 'echo 1 > /proc/sys/vm/drop_caches'
|
||||
sudo bash -c 'echo 1 > /proc/sys/vm/compact_memory'
|
||||
bash -c 'echo 1 > /proc/sys/vm/drop_caches'
|
||||
bash -c 'echo 1 > /proc/sys/vm/compact_memory'
|
||||
free -m
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user