error: internal error cannot parse json info block: lexical error: invalid char in json text.
info block
(right here) ——^
Fix:
virsh # qemu-monitor-command DOMAIN –hmp –cmd “info block”
error: internal error cannot parse json info block: lexical error: invalid char in json text.
info block
(right here) ——^
Fix:
virsh # qemu-monitor-command DOMAIN –hmp –cmd “info block”
It looks like nice job:
#!/bin/bash
# compact.sh by Devon of ByteOnSite for OpenVZ
# SETTINGS
# Config Directory
CFG="/tmp"
# VZ Partition
VZ=`cat $CFG/compact.vzdir 2>/dev/null`
# Run Compact Automatically Every X Runs. Default: 96 runs, if run every 15 minutes this is every 24 hours.
ONXRUNS=`cat $CFG/compact.onxruns 2>/dev/null`
# Minimum Free Space in MB. Will attempt to compact if free space drops below this. Default: automatically generated, 5% free space.
MINFREE=`cat $CFG/compact.minfree 2>/dev/null`
# Email Address
EMAIL=`cat $CFG/compact.email 2>/dev/null`
# Log enabled
LOG=`cat $CFG/compact.logging 2>/dev/null`
# END SETTINGS
# DEFAULT SETTINGS
# Default VZ Partition
if [ ! $VZ ]; then
VZ="/vz"
echo $VZ > $CFG/compact.vzdir
fi
# Default ONXRUNS
if [ ! $ONXRUNS ]; then
ONXRUNS=96
echo $ONXRUNS > $CFG/compact.onxruns
fi
# Default MINFREE (5% of Total Partition)
if [ ! $MINFREE ]; then
MINFREE=$[`df -PBM $VZ | awk 'NR==2 {print $2}' | cut -f1 -dM`/20]
echo $MINFREE > $CFG/compact.minfree
fi
if [ ! $LOG ]; then
LOG=1
echo $LOG > $CFG/compact.logging
fi
# END DEFAULT SETTINGS
# LOGIC
FREESPACE=`df -PBM $VZ | awk 'NR==2 {print $4}' | cut -f1 -dM`
# DEBUG
if [ "$1" = "debug" ]; then
echo "CFG: $CFG"
echo "VZ: $VZ"
echo "FREESPACE: ${FREESPACE}MB"
echo "MINFREE: ${MINFREE}MB"
echo "ONXRUNS: $ONXRUNS"
echo "LOG: $LOG"
echo "EMAIL: $EMAIL"
if [ ! -f "/bin/mail" ]; then
echo "MAILX: NOT FOUND. EMAILS WON'T BE SENT ON WARNING"
fi
exit 0
fi
# END DEBUG
i=`cat $CFG/compact.count`
if [ ! "$i" ] || [ "$i" -eq $ONXRUNS ]; then
i=1
fi
if [ $i -eq 1 ] || [ $FREESPACE -lt $MINFREE ]; then
# Run compact for every VPS
stdout="/dev/null"
if [ $LOG -eq 1 ]; then
stdout="$CFG/compact.log"
fi
for veid in `vzlist -H -o veid`
do
date=`date`
echo "Starting compact on VEID $veid at $date.." >$stdout 2>&1
vzctl compact $veid >$stdout 2>&1
done
# Check disk space again
FREESPACE=`df -PBM $VZ | awk 'NR==2 {print $4}' | cut -f1 -dM`
if [ $FREESPACE -lt $MINFREE ]; then
message="Unable to compact containers enough to reduce free space below MINFREE levels. Free Space: $FREESPACE MB."
echo $message | wall
hostname=`hostname`
if [ $EMAIL ]; then
echo $message | mail -s "Compact failure on $hostname" $EMAIL
fi
fi
fi
# Increase count
i=$[$i+1]
echo $i > $CFG/compact.count
# END LOGIC
exit 0
vzquota show 100
vzquota : (warning) Quota is running, so data reported from quota file may not reflect current values
resource usage softlimit hardlimit grace
1k-blocks 0 4194304 4194304
inodes 25 200000 220000
vzctl stop 100
vzquota init 100 -p /vz/private/100 -b 4194304 -B 4194304 -i 200000 -I 220000 -e 0 -n 0
Inside container: ctrl+p ctrl+q
sudo docker rmi $(docker images -q)
ls -la /vz/private/*/root.hdd/DiskDescriptor.xml
vzctl stop 100
ploop mount /vz/private/100/root.hdd/DiskDescriptor.xml
fdisk -l /dev/ploop100p1
e2fsck /dev/ploop100p1
ploop umount -d /dev/ploo100p1
vzctl –verbose –verbose –verbose start 100
vzctl console 1234
OLDVE=222 NEWVE=333 # Just an example
vzctl stop $OLDVE
mkdir /vz/root/$NEWVE
cp /etc/vz/conf/$OLDVE.conf /etc/vz/conf/$NEWVE.conf
mkdir /vz/private/$NEWVE
pushd /vz/private/$OLDVE; tar c –numeric-owner * | tar x –numeric-owner -C /vz/private/$NEWVE; popd
vi /etc/vz/conf/$NEWVE.conf # Change the IP_ADDRESS
vzctl start $NEWVE; vzctl start $OLDVE
Fix.
vzctl set XXX --disabled no --save
vzctl start XXX
Powerful and Innovative: Most advanced and innovative enterprise-class functionality for the management of virtualized data centers to build private and hybrid clouds.
vzctl set 1010 –cpus 1 –save
If you see this message on OpenVZ container. if sh exists or this is symbolic link, usually it means you have some damaged binary files. You can take them from OS template.
Add ISO cdrom:
attach-disk your_domain_name /path/to/your.iso hdc --type cdrom --mode readonly
change ISO cdrom:
attach-disk your_domain_name /path/to/your/new.iso hdc --type cdrom
--mode readonly
remove ISO cdrom:
attach-disk your_domain_name " " hdc --type cdrom --mode readonly