Category Archives: Virtualization

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

create LVM volumes for KVM servers

You need describe your LVM volume group in XML format:

vgs
vi /etc/libvirt/storage/vg_server1.xml

vg1
/dev/vg_server1

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

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