Create snapshot including memory on ESXi command line

Today I have been asked how to create a snapshot directly on the ESXi host using vim-cmd including virtual machine memory.

Quick example from my lab:

Get the VMID of the virtual machine

[root@esxi:~] vim-cmd vmsvc/getallvms

Sample output:

VMIDNAMEFileGuest OSVersionRemark
121vcsa[Local2] vcsa/vcsa.vmxother3xLinux64Guestvmx-10VMware vCenter Server Appliance
124vRLi[Local2] vRLi/vRLi.vmxsles11_64Guestvmx-09VMware vRealize Log Insight
125vROPs[Local2] vROPs/vROPs.vmxsles11_64Guestvmx-11vRealize Operations Manager Appliance

Create snapshot including memory

[root@esxi:~] vim-cmd vmsvc/snapshot.create 124 "SnapshotName" "Snapshot Description" true true
Create Snapshot:
[root@esxi:~]

Result:

[root@esxi:~] vim-cmd vmsvc/snapshot.get 124
Get Snapshot:
|-ROOT
--Snapshot Name        : SnapshotName
--Snapshot Id        : 1
--Snapshot Desciption  : Snapshot Description
--Snapshot Created On  : 3/7/2019 14:33:24
--Snapshot State       : powered on
[root@esxi:~]

ESX IP STORAGE TROUBLESHOOTING BEST PRACTICE

VMware has released a new White paper about ESXi IP storage troubleshooting.

In this paper, we:
• Describe how you can analyze packet traces to identify functional and performance issues in an
ESX IP storage environment.
• Compare packet capture alternatives, and explain why we recommend an inline optical network
tap connected to a packet capture system.
• Present the challenges of 10G packet capture, and describe key features of commercial 10G
capture solutions.
• Describe the design of an inexpensive, self-assembled 10G packet capture solution optimized for
troubleshooting that you can build relatively easily. We also describe our experience with multiple
prototypes of this design, which we have used in our ESX IP storage testbeds for NFS and iSCSI
performance for many years.
• Present examples of analyzing packet traces to solve ESX performance issues for NFSv41, software
iSCSI over IPv6, and hardware iSCSI.

ESX-IP-storage-troubleshooting.pdf

Time to replace my Homelab – Part 1

My current homelab contains 2x HP ML10v2, 1x HP Microserver Gen8 and 2 Switches (1 Mikrotik Cloud Switch 24 Port, Zyxcel 16 Port). This setup was sufficient for a long time. But due to the increased resource requirements of some VMware products and my activities with vROPs, Log Insight and other solutions I require more resources. Furthermore I would like to reduce from 3 to 1 server and run more activities virtually based on the lab scripts from William Lam.

Current Setup:

HostnameCPUMemoryStorageAdd-On
xmesx01eIntel® Pentium® G3240 (3.1GHz/2-core/3MB/54W)32 GB1x 240GB Intel SSD1x HP Quad Gbit NIC
xmesx02eIntel® Pentium® G3240 (3.1GHz/2-core/3MB/54W)20 GB1x 240GB Intel SSD1x HP Quad Gbit NIC
Storage (Freenas on HP Microserver Gen8):Intel® Pentium® G2020T (2.5GHz/2-core/3MB/35W)16 GB4x 2TB WD RED1x HP Smart Array P410 + 512MB Cache Modul + Battery

New Setup:

CategoryDescription
Type:HP Proliant DL380 G7  
ChipsetIntel  ®   5520 Tylersburg + Intel ICH 10
CPU TypIntel ®  Xeon ®  CPU L5630
CPU Speed2.13 GHz
Cores / Threads2 CPU(s), 4 Cores per CPU, 2 Thread(s) per Core, 16 total
L1, L2, L3 Cache32k+32k,   256k,    12288k (12 MB)
Memory32 GB DDR3 ECC 
Installed8 x 4 GB
SAS - Controller:HP Smart Array P410i Controller
Controller PCIe:1x GB LAN Broadcom PCIe Karte
2x Fiber Channel Finsar Singel Port PCIe card
Disks8x 2,5“ SAS HDDs 

The plan is to extend the machine with 8x 146GB SAS disks and additionally upgrade the memory to 144GB at least. The FC card will be removed as it will not be used in my Homelab.

If someone is interested in buying one or two HP ML10v2 please send my a message.

to be continued …

vCenter notification send push message using Prowl to iOS devices

I would like to receive push messages for triggered alerts from my vCenter. There is the possibility to execute a command when a alert has been triggered so I decided to write a script which will use Prowl to send push notification to my mobile apple device. I used Prowl already for other devices like my Homematic home automation system. It’s easy to use with an simple curl command. You can find a lot of good examples available by using Google.

Sources and Services:

VMware Documentation

Push notification service

You have to create an account on www.prowlapp.com and generate a new API key. The new API key has to be added to script (replace PLACE_YOUR_API_KEY_HERE with your API key).

Script:

This script is really basic and is only a proof of concept. I will extend and improve it over time.

root@vcenter [ ~ ]# mkdir bin
root@vcenter [ ~ ]# cd bin
root@vcenter [ ~/bin ]# vi alert.sh
#!/bin/bash
#set -x

value="$VMWARE_ALARM_ALARMVALUE"
if [ $$value == "red" ]; then
priority=2
else
priority=0
fi
app="$VMWARE_ALARM_NAME"
event="$VMWARE_ALARM_EVENTDESCRIPTION"
description="$VMWARE_ALARM_TARGET_NAME"
apikey=PLACE_YOUR_API_KEY_HERE

curl https://prowl.weks.net/publicapi/add -F apikey=$apikey -F priority=$priority -F application="$app" -F event="$event" -F description="$description"

Edit vCenter alert definition:

To receive the push notification you have to install the prowl app on your iOS device and login from the app to prowl.

Thats basically all what is required for vCenter push notifications on your iPhone.