Sunday, December 28, 2014

VMware Snapshots

              A disk snapshot is a copy of the virtual machine disk file at a certain point in time. It preserves the disk file system and system memory of your virtual machine



Name – Name for the snapshot.

Description – Description of the snapshot.

Snapshot the virtual machine’s memory – All the memory in active use on the virtual machine is written to a memory dump file (vmsn file) that is included in the snapshot.

Quiesce guest file system (Needs VMware Tools installed) –it’s used to pause running processes on the guest operating system so that file system contents are in a known consistent state when you take the snapshot.
You can only take the snapshot when VM is powered


                      To quiesce is to put a computer, a program, a thread , or some other computer resource into a temporarily inactive or inhibited state

VMware recommends the following best practices regarding snapshots:

  •  Do not keep a single snapshot for more than 72 hours. While VMware supports up to 32 snapshots in a chain, try to limit chains to three snapshots.
  •  Do not rely upon snapshots for I/O intensive VMs with rapid data changes, because significant data inconsistencies will occur when the VM is restored.

 


Friday, December 26, 2014

Raw Device Mapping(RDM)

                          A Raw Disk Mapping (RDM) can be used to present a LUN directly to a virtual machine from a SAN. Rather than creating a virtual disk (VMDK) on a LUN, which is generally shared with other VMs and virtual disks.

  1.    With RDM, the VMkernel doesn't format the LUN; instead, the VM guest OS formats the  LUN.
  2.    Each RDM is a single VM hard disk and is usually attached to a single VM.
  3.    An RDM takes the place of a VMDK file for a VM.
  4.    The biggest limitation with RDMs is that the one LUN is only one VM disk.
  5.    ESXi server can only handle 255 LUNs. RDMs means there is only room for 254 RDM VM disks, plus one data store for the VM files.
  6.    With VMFS data stores, the 255 LUNs could hold thousands of VM disks.

              The advantage of VMFS is that a single disk -- logical unit number(LUN) in storage-area network (SAN) terms -- can hold multiple virtual machines.

           A single LUN can assign an average number of a dozen VM.

           The reasons for doing this should purley be for functional and management reasons, NOT performance. There is a mis-understanding that RDMs offer greater performance compared to VMDK's on a VMFS datastore. I've seen lots of vSphere environments that have gone over kill on RDMs for SQL servers and the like for "performance reasons", its difficult to manage! If your looking for improved storage performance look into the VMware Paravirtual SCSI (PVSCSI) adaptor.

The main reason for using an RDM should be as follows:

  •   To utilize native SAN tools and commands
  •   Big VM disks. The largest VMDK file you can create is 2TB, but a single RDM can be up to 64TB
  •   If using Microsoft Cluster Services (MSCS), Failover Clusters or other clustering solution
  •   Disaster Rcovery -connect RDM to another physical host.
  •   RDM will not included in snapshot if physical compatibility mode is used


LUNs presented from FC, FCoE and iSCSI are supported for RDMs.

There are two RDM modes to be aware of:

•    Virtual compatability mode provides vSphere snapshots of this virtual disk.
•    Physical compatability mode allows the VM to pass SCSI commands direct to the storage system LUN. This allows it to leverage SAN specific features such as interation with the SANs own snapshot functions.

Create a Raw Device Mapping Disk on a Virtual Machine

1. The first step to adding a RDM to a virtual machine is to assign an unused LUN to your ESXi Servers. This will vary depending on the type of SAN in use (consult the SAN vendors documentation on how to do this).

2. For the new LUN to become available, Rescan the HBAs on all your ESXi servers.


3. The virtual machine that the RDM is going to be added to needs to be shut down first, the RDM cannot be added while it is running.

4. On the hardware tab, click "Add" and choose "Hard Disk".

5. For the disk type choose "Raw Device Mapping" (RDM). Click Next.

6. Choose the LUN. Click Next.

7. Choose "Store with virtual machine" or if you want store the link to the RDM in a specific datastore. Click Next.
 8. RDM volumes can be created in either "Physical" or "Virtual" compatability mode:
                  Virtual compatability mode provides vSphere snapshots of this virtual disk.
                  Physical compatability mode allows the VM to pass SCSI commands direct to the storage system LUN. This allows it to leverage SAN specific features such as interation with the SANs own snapshot functions.
9. The RDM must be located on a seperate SCSI controller.
                 Choose a Virtual Device Node that is on a different SCSI bus to the current virtual disks (e.g. SCSI 1:0).Click next.
  

 10. Confirm settings and choose finish.
 11. A new SCSI controller and hard disk is added to the virtual machine configuration. Now boot your VM. Depending on the OS check for new disks and format/mount the disk.




Thursday, December 25, 2014

vSphere CLI commands




Documentation
Description
Lists descriptions of esxcli commands.
FCOE (Fibre Channel over Ethernet) comands
Hardware namespace. Used primarily for extracting information about the current system setup.
iSCSI namespace for minitoring and managing hardware and software iSCSI.
License management commands.
Network namespace for managing virtual networking including virtual switches and VMkernel network interfaces.
Software namespace. Includes commands for managing and installing image profiles and VIBs.
Includes core storage commands and other storage management commands.
System monitoring and management command.
Namespace for listing virtual machines and shutting them down forcefully.
Moves a virtual machine's configuration file and optionally its disks while the virtual machine is running. Must run against a vCenter Server system.
Performs advanced configuration including enabling and disabling CIM providers. Use this command as instructed by VMware.
Manages Active Directory authentication.
Backs up the configuration data of an ESXi system and restores previously saved configuration data.
Specifies an ESX/ESXi host's DNS (Domain Name Server) configuration.
Manages diagnostic partitions.
Allows you to start, stop, and examine ESX/ESXi hosts and to instruct them to enter maintenance mode and exit from maintenance mode.
Supports setup of IPSec.
Manages iSCSI storage.
Enables VMkernel options. Use this command with the options listed, or as instructed by VMware.
Displays information about storage array paths and allows you to change a path's state.
Configures multipath settings for Fibre Channel or iSCSI LUNs.
Manages NAS file systems.
Manages the ESX/ESXi host's NICs (uplink adapters).
Specifies the NTP (Network Time Protocol) server.
Rescans the storage configuration.
Lists or changes the ESX/ESXi host's route entry (IP gateway).
Finds available LUNs.
Manages the Simple Network Management Protocol (SNMP) agent.
Specifies the syslog server and the port to connect to that server for ESXi hosts.
Creates, modifies, deletes, and lists local direct access users and groups of users.
Adds, deletes, and modifies virtual network adapters (VMkernel NICs).
Supports resignaturing a VMFS snapshot volume and mounting and unmounting the snapshot volume.
Adds or removes virtual switches or vNetwork Distributed Switches, or modifies switch settings.
Performs file system operations such as retrieving and uploading files on the remote server.
Manages updates of ESX/ESXi hosts. Use vihostupdate35 for ESXi 3.5 hosts.
Manages updates of ESX/ESXi version 3.5 hosts.
Creates and manipulates virtual disks, file systems, logical volumes, and physical storage devices on ESX/ESXi hosts.
Performs virtual machine operations remotely. This includes, for example, creating a snapshot, powering the virtual machine on or off, and getting information about the virtual machine.