You need check free RAM memory. free -m
Category Archives: Virtualization
docker create redmine
mkdir /opt/mysql/data
sudo docker run –name mysql -it –rm -v /opt/mysql/data:/var/lib/mysql sameersbn/mysql:latest
150429 16:50:41 mysqld_safe Logging to syslog.
150429 16:50:41 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
sudo docker exec -it mysql bash
mysql -uroot -p
CREATE USER ‘redmine’@’%.%.%.%’ IDENTIFIED BY ‘password’;
CREATE DATABASE IF NOT EXISTS `redmine_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `redmine_production`.* TO ‘redmine’@’%.%.%.%’;
sudo docker run –name=redmine -it –rm –link mysql:mysql -e “DB_USER=redmine” -e “DB_PASS=password” -e “DB_NAME=redmine_production” -v /opt/redmine/data:/home/redmine/data sameersbn/redmine:latest
Generating secure token…
2015-04-29 17:14:03,461 CRIT Supervisor running as root (no user in config file)
2015-04-29 17:14:03,461 WARN Included extra file “/etc/supervisor/conf.d/unicorn.conf” during parsing
2015-04-29 17:14:03,461 WARN Included extra file “/etc/supervisor/conf.d/nginx.conf” during parsing
2015-04-29 17:14:03,461 WARN Included extra file “/etc/supervisor/conf.d/cron.conf” during parsing
2015-04-29 17:14:03,500 INFO RPC interface ‘supervisor’ initialized
2015-04-29 17:14:03,500 CRIT Server ‘unix_http_server’ running without any HTTP authentication checking
2015-04-29 17:14:03,500 INFO supervisord started with pid 1
2015-04-29 17:14:04,504 INFO spawned: ‘unicorn’ with pid 131
2015-04-29 17:14:04,506 INFO spawned: ‘cron’ with pid 132
2015-04-29 17:14:04,509 INFO spawned: ‘nginx’ with pid 133
2015-04-29 17:14:06,363 INFO success: unicorn entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2015-04-29 17:14:06,364 INFO success: cron entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2015-04-29 17:14:06,364 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
sudo docker inspect redmine | grep -i ip
[vit@localhost docker-redmine]$ sudo docker inspect redmine | grep -i ip
“IpcMode”: “”,
“GlobalIPv6Address”: “”,
“GlobalIPv6PrefixLen”: 0,
“IPAddress”: “172.17.0.19”,
“IPPrefixLen”: 16,
“IPv6Gateway”: “”,
“LinkLocalIPv6Address”: “fe80::42:acff:fe11:13”,
“LinkLocalIPv6PrefixLen”: 64,
Now you can access redmine using IPAddress. Default user admin, password admin.
chmod: changing permissions of ‘/home/redmine/data’: Permission denied
On your local system:
sudo chown -R root:root /opt/redmine
sudo chcon -Rt svirt_sandbox_file_t /opt/redmine/
lxc vs lxd
Features of LXD are:
Secure by design (unprivileged containers, resource restrictions and much more)
Scalable (from containers on your laptop to thousand of compute nodes)
Intuitive (simple, clear API and crisp command line experience)
Image based (no more distribution templates, only good, trusted images)
Live migration
esx cheat sheet
How to get ESXi version information?
~ # esxcli system version get
Product: VMware ESXi
Version: 5.5.0
Build: Releasebuild-1623387
Update: 1
How to get the uuid?
~ # esxcli system uuid get
53bf0f5e-5b22-8964-2574-000c29f89b93
How to get the hostname ?
~ # esxcli system hostname get
Domain Name: ganesh.com
Fully Qualified Domain Name: esx1.ganesh.com
Host Name: esx1
How to check the Load on server ? we can also use “uptime” for same
~ # esxcli system process stats load get
Load1Minute: 0.02
Load15Minutes: 0.03
Load5Minutes: 0.02
How Many processes are running on ESXi ?
~ # esxcli system process stats running get
Running Processes: 405
How to get the boot device information for ESXi?
~ # esxcli system boot device get
Boot Filesystem UUID: 5bba5c75-aadf80d0-d554-c0ac58729550
Boot NIC:
Stateless Boot NIC:
How to see the coredump device used to capture dump ?
~ # esxcli system coredump file list
Path Active Configured Size
——————————————————————————————————- —— ———- ———
/vmfs/volumes/53c033b3-b6a7b6f3-e8bf-000c29f89b93/vmkdump/564D3C1B-1B4F-DD7B-61A7-737834F89B93.dumpfile true true 119537664
How to see the coredump partition information ?
~ # esxcli system coredump partition list
Name Path Active Configured
————————————————————————– ———————————————————————————————- —— ———-
t10.ATA_____VMware_Virtual_IDE_Hard_Drive___________00000000000000000001:7 /vmfs/devices/disks/t10.ATA_____VMware_Virtual_IDE_Hard_Drive___________00000000000000000001:7 true true
How to list the loaded module? Partial output is shown.
~ # esxcli system module list
Name Is Loaded Is Enabled
—————————– ——— ———-
vmkernel true true
chardevs true true
user true true
vmkapi_socket true true
procfs true true
procMisc true true
How to see the information related to particular Module ?
~ # esxcli system module get -m swapobj
Module: swapobj
Module File: /usr/lib/vmware/vmkmod/swapobj
License: VMware
Version:
Signed Status: VMware Signed
Signature Issuer: VMware, Inc.
Signature Digest: 7308 1040 f1ab 8d96 07c0 0a51 eef7 3fd4 a836 01a1 0341 fc15 21bd 97da ce61 6073
Signature FingerPrint: cb44 247a 1614 cea1 2079 362d ec86 9d0e
Provided Namespaces: com.vmware.swapobj@0
Required Namespaces: com.vmware.vmkapi@v2_2_0_0, com.vmware.vmkapi.incompat@v2_2_0_0, com.vmware.vmklinkmpi@0, [email protected]
How to see the log rotation policies ?
~ # esxcli system syslog config get
Default Network Retry Timeout: 180
Local Log Output: /scratch/log
Local Log Output Is Configured: false
Local Log Output Is Persistent: true
Local Logging Default Rotation Size: 1024
Local Logging Default Rotations: 8
Log To Unique Subdirectory: false
Remote Host:
How to see special purpose file systems?
~ # esxcli system visorfs ramdisk list
Ramdisk Name System Include in Coredumps Reserved Maximum Used Peak Used Free Reserved Free Maximum Inodes Allocated Inodes Used Inodes Mount Point
———— —— ——————– ——— ———- ——– ——— —- ————- ————– —————- ———– —————————
root true true 32768 KiB 32768 KiB 460 KiB 468 KiB 98 % 98 % 8192 4096 3559 /
etc true true 28672 KiB 28672 KiB 180 KiB 212 KiB 99 % 99 % 4096 1024 463 /etc
tmp false false 2048 KiB 196608 KiB 8 KiB 232 KiB 99 % 99 % 8192 256 4 /tmp
hostdstats false false 0 KiB 84992 KiB 1784 KiB 1784 KiB 97 % 0 % 8192 32 4 /var/lib/vmware/hostd/stats
******************************************HARDWARE*****************************************
How to list the CPU information related to ESXi?
~ # esxcli hardware cpu global get
CPU Packages: 1
CPU Cores: 2
CPU Threads: 2
Hyperthreading Active: false
Hyperthreading Supported: false
Hyperthreading Enabled: true
HV Support: 3
HV Replay Capable: false
HV Replay Disabled Reasons: incompatible CPU
How to list the details information related to each core ?
~ # esxcli hardware cpu list
CPU:0
Id: 0
Package Id: 0
Family: 6
Model: 60
Type: 0
Stepping: 3
Brand: GenuineIntel
Core Speed: 3400060000
Bus Speed: 66000000
APIC ID: 0x0
Node: 0
L2 Cache Size: 262144
L2 Cache Associativity: 8
L2 Cache Line Size: 64
L2 Cache CPU Count: 2
L3 Cache Size: 8388608
L3 Cache Associativity: 16
L3 Cache Line Size: 64
L3 Cache CPU Count: 2
CPU:1
Id: 1
Package Id: 0
Family: 6
Model: 60
Type: 0
Stepping: 3
Brand: GenuineIntel
Core Speed: 3400060000
Bus Speed: 66000000
APIC ID: 0x1
Node: 0
L2 Cache Size: 262144
L2 Cache Associativity: 8
L2 Cache Line Size: 64
L2 Cache CPU Count: 2
L3 Cache Size: 8388608
L3 Cache Associativity: 16
L3 Cache Line Size: 64
L3 Cache CPU Count: 2
How to check the physical memory present ?
~ # esxcli hardware memory get
Physical Memory: 4294430720 Bytes
Reliable Memory: 0 Bytes
NUMA Node Count: 1
How to Check the Hardware Clock ?
~ # esxcli hardware clock get
2014-07-15T18:30:34Z
How to list PCI devices connected ?
~ # esxcli hardware pci list | more
000:000:00.0
Address: 000:000:00.0
Segment: 0x0000
Bus: 0x00
Slot: 0x00
Most useful command to check the serial number of physical server and other related information to HW.
~ # smbiosDump.
vEMan – VMware ESX/ESXi Manager
Features
Support vEMan development for v2.0: http://www.gofundme.com/vEMan
Nice GUI for Linux users 😉
Professional Support available!
Deploy OVF from a website to your ESX
Deploy OVF/VMX from local disk to your ESX
Show a list of all your online, suspended and offline VM’s on your ESX
Supporting Ressource Pools
VM-Management: Console (Enable,Disable,Open)
VM-Management: Snapshots (Show,Revert to,Remove,Create,Rename)
VM-Management: Power (Stop,Shutdown,Reboot,Start,Suspend, Resume)
VM-Management: VM status (online/suspended/offline,CPU/MEM usage and many more)
VM-Management: Delete a VM
ESX-Information: Global CPU & MEM usage, ESX version and many more
ESX-Management: add user, change user passwords, change user roles, ..
Planned (v1.0): Simple VM Editor (change CPU count and RAM, Rename VM)
Planned (v2.0): Rewrite vEMan in Python, Using pySphere library instead of VMware SDK
Planned (undecided): Browse datastorages
Planned (undecided): Upload file to a specific datastorage
Support vEMan development for v2.0: http://www.gofundme.com/vEMan
openvz migrate all containers
for CT in $(vzlist -H -o veid); do vzmigrate –remove-area no –keep-dst $1 $CT; done
docker create container
docker run -i -t –name guest oraclelinux:6.6 /bin/bash
migrate docker container
sudo docker ps
Export:
sudo docker export 9a276b8fe557 > /home/vit/pyt.tar
du -sh /home/vit/pyt.tar
963M /home/vit/pyt.tar
du -sh /home/vit/pyt.tar.gz
374M /home/vit/pyt.tar.gz
Import:
cat /tmp/pyt.tar | sudo docker import –
docker attach the same container
sudo docker exec -it container_name bash
vzmigrate safe migration
vzmigrate --online --keep-dst --remove-area no -v x.x.x.x 100
openvz migrate all vps
for CT in $(vzlist -H -o veid); do vzmigrate –remove-area no –keep-dst $1 $CT; done
kvm add iso: virsh add cdrom iso image
virsh # qemu-monitor-command DOMAIN –hmp –cmd “info block” | grep removable
virsh # qemu-monitor-command DOMAIN –hmp –cmd “change drive-ide0-1-0 /tmp/some.iso”
virsh # qemu-monitor-command DOMAIN –hmp –cmd “eject drive-ide0-1-0”
error: unsupported configuration: unsupported driver name ‘file’ for disk
If you are trying to do this:
virsh # attach-disk DOMAIN /root/some.iso hdc –driver file –type cdrom –mode readonly
Try to do:
virsh # attach-disk DOMAIN /tmp/some.iso hdc –type cdrom –mode readonly
error: internal error unable to execute QEMU command ‘change’: Could not open ‘/root/some.iso’: Permission denied
Fix. mv -v /root/some.iso /tmp/some.iso