vzctl chkpnt 101 –dumpfile /tmp/Dump.101
mv /etc/vz/conf/101.conf /etc/vz/conf/102.conf
mv /vz/private/101 /vz/private/102
mv /vz/root/101 /vz/root/102
vzctl restore 102 –dumpfile /tmp/Dump.101
Category Archives: Virtualization
Error: Failed to copy top ploop delta
yum install ploop
openvz error: openpty: No such file or directory
CTID=100
vzctl exec $CTID “mount -t devpts devpts /dev/pts”
vzctl enter $CTID
it works on Debian containers.
vzctl exec 101 /sbin/MAKEDEV tty
vzctl exec 101 /sbin/MAKEDEV pty
vzctl exec 101 mknod –mode=666 /dev/ptmx c 5 2
vzctl enter 101
On RH OS.
openvz per-container disk I/O bandwidth and IOPS limiting
vzctl set 100 --iolimit 1M --save
vzctl enter 100
cat /dev/urandom | pv -c - > /tmp/test_io
NSX
Programmatically create, provision, snapshot, delete and restore complex networks all in software. VMware NSX™ breaks through current physical network barriers, enabling data center operators to achieve order of magnitude better speed, economics and choice.
virt-sandbox
The virt-sandbox command is used to dynamically create sandboxes for running interactive / batch commands.
The libvirt guest is created when the virt-sandbox command starts
The libvirt guest is automatically deleted when the virt-sandbox command completes, or dies from a signal
The sandboxed command sees a read-only view of the entire host filesystem
Specific areas can be made writable by mapping in an alternative host directory
There is no network access inside the sandbox by default
Virtual network interfaces can be associated with libvirt virtual networks
The stdin/stdout/stderr file handles of the sandbox command will be connected to the controlling terminal.
The virt-sandbox support multiple virtualization drivers, so a URI should be specified when running them to choose the techology to use
lxc:/// – valid if the calling user is root
qemu:///session – valid if the calling user is non-root
qemu:///system – valid if the calling user is root. NB there are some current known issues with this driver which temporarily prevent its use
Sandboxes can be used to run interactive commands, such as shells
# virt-sandbox -c lxc:/// /bin/sh
Or output-only commands
# virt-sandbox -c qemu:///session /bin/cat /proc/cpuinfo
convert xz to gz fast way
xzcat arch-20140707-x86_64.tar.xz | gzip > arch-20140707-x86_64.tar.gz
openvz change container root password
vzctl set VPS_ID –userpasswd root:newpassword
create LVM volumes for KVM servers
You need describe your LVM volume group in XML format:
vgs
vi /etc/libvirt/storage/vg_server1.xml
virsh pool-define /etc/libvirt/storage/vg_server1.xml
virsh pool-start vg1
virsh pool-autostart vg1
virsh pool-info vg1
now use virt-instal:
virt-install -d --hvm --vnc --name=server1 --ram 5000 --disk pool=vg1,size=100,bus=virtio,cache=none --network network=default,model=virtio \
--location=http://mirror.duomenucentras.lt/centos/7/os/x86_64/ \
--os-type=linux
openvz fake swap
#!/bin/bash
SWAP=”${1:-512}”
NEW=”$[SWAP*1024]”; TEMP=”${NEW//?/ }”; OLD=”${TEMP:1}0″
umount /proc/meminfo 2> /dev/null
sed “/^Swap\(Total\|Free\):/s,$OLD,$NEW,” /proc/meminfo > /etc/fake_meminfo
mount –bind /etc/fake_meminfo /proc/meminfo
free -m
vmware top fix output over ssh connection
TERM=xterm esxtop
vmware netstat equivalent
esxcli network ip connection lis
vmware determine disk space
vdf -h
vmware get hdd information
esxcfg-scsidevs -l | egrep -i ‘display name|vendor’
t10.ATA_____ST2000DM0012D9YN164__________________________________W240RSE6
Device Type: Direct-Access
Size: 1907729 MB
Display Name: Local ATA Disk (t10.ATA_____ST2000DM0012D9YN164__________________________________W240RSE6)
Multipath Plugin: NMP
Console Device:
Devfs Path:
Vendor: ATA Model: ST2000DM001-9YN1 Revis: CC4B
SCSI Level: 5 Is Pseudo: false Status: not connected
Is RDM Capable: false Is Removable: false
Is Local: true Is SSD: false
Other Names:
vml.01000000002020202020202020202020205732343052534536535432303030
VAAI Status: unknown
verify that the VIBs are installed on your ESXi host
esxcli software vib list