VMware vSphere
vSphere is a server virtualization platform from VMware. It is not an operating system or application per se. The name covers a range of technologies under the VMWare Infrastructure umbrella since version 4.
Overview
Software Defined Data Center is where all infrastructure (network, machines, storage) is virtualized.
Virtualization is the process of creating a software-based representation of physical machines, networks, or storage. VMs itself is a running program that represent a physical machine and its properties can be configured programatically (such as storage, network, cpu, memory, etc).
Other benefits include:
- Isolated from other VMs, and
- Sheltered from physical hardware changes/faults.
- Files can be provisioned into VMs, or snapshotted, or moved, etc.
- ACLs can be made to limit user access to certain VMs or resources.
Core resources managed by the vmkernel:
- CPU
- Memory
- Disk
- Network
ESXi Host
A ESXi host (also called vmkernel, hypervisor) can run a total 1024 VMs per host with a maximum of 4096 Virtual CPUS per host. Minimum/Maximum requirements are:
- 2 - 768 CPUs per ESXi host
- 4GB-16TB memory limit
- 32 Gigabit ports, or 16 10Gbit adapters, or 4 25/40/50/100Gbit adapters.
Hosted Architecture - using a generic OS (such as windows, linux) to run VMs. Compare this to Bare Metal Architecture - using an actual minimal hypervisor built for running VMS such as ESXi, or HyperV.
hostd is a process that runs on every ESXi host that is responsible for most operations on the host as well as communicating with the vmkernel. Clients communicate witht hostd to control the host. vpxa is the agent that uses hostd to control the ESXi host.
Storage
Storage on ESXi are also known as datastores and is the location where virtual machine data is stored. There are serveral different backing methods that can be used for datastores:
- Local, vmfs
- SAN
- Fibre Channel (FC)
- Fibre Channel over Ethernet (FCoE)
- iSCSI
- NAS via NFS
- vSAN (vSphere 5.5) vsphere san
- VVOLS (vSphere 6.0) virtual volumes
Virtual machine data is stored as virtual disks (vmdk).
Files representing a virtual disk:
- vmdk - contains disk directory info, adapter type, geometry information
- flat.vmdk - the actual disk data
These virtual disks can also be made to link/map to another file or physical device using Raw Device Mapping (RDM). RDM files cannot be saved on NFS datastores (?)
- Virtual: vdm 62TB, a mapping/pointer to another vmdk file
- Physical: vdmp 64TB, a mapping/pointer to a physical disk/lun
Disk allocation can be set as:
- Thin: Allocates blocks as they are written
- Thick : Allocates all blocks up front
- Lazy: Writes 0s when requested
- Eager: Writes 0s when disk is initialized
vSAN is a proprietry software that pools storage from multiple hosts into a single datastore. It requires that each host contribute to the pool using only SSDs, or SSDs and HDD combination. A minimum of 10% SSD must be present for it to contribute storage to the pool. The storage is mounted as an Object Store File System (OSFS)
There is a maximum of 64 concurrent host access to shared storage. (same as the number of hosts per cluster)
NFS 3 requires no_root_squash export option.
NFS 4 has optional kerberos authentication as well as built-in file locking support.
Best practice is to have multiple NICs on multiple switches to the NAS. Use IP Hash to improve throughput.
vCenter
vCenter Server allows central management over multiple ESXi hosts and their virtual machines. The vCenter server package can be installed on Windows/Linux (up to 6.7), but is now a virtual appliance (VCSA, vCenter Software Appliance). vCenter can orchestrate features such as Distributed Resource Scheduler (DRS), HA, Fault Tolerance, vMotion, Storage vMotion.
There are two groups of services:
- vCenter Server services
- vSphere Client, vSphere Server, the vSphere Web Client, Update Manager, auto deploy, esxi dump collector
- cannot have multiple servers but vCenter can be set up in a HA arrangement (active-passive, witness) mode if using the appliance version
- Platform Services Controller (PSC)
- New service group starting from vSphere 6 that handles infrastructure security, certificate management, server reservation
- vCenter single sign-on, vmware directory services (VMware's implementation of LDAP), license server, lookup service, vmware CA, certificate store
- Can be load balanced with multiple controller servers from different regional locations
Limits:
- 25k powered on vms, 65k vm inventory, 2000 ESXi hosts
- 64 hosts per cluster, 8000 VMs per cluster
The embedded database bundled with Windows vCenter shoudln't be used with more than 20 ESXi hosts or 200 VMs.
The appliance version includes both the vCenter Server and Platform Services Controller services and runs on VMware Photon OS with PostgreSQL.
Virtual Provisioning X Agent (VPXA) gets installed on the ESXi host when it is added to the vCenter inventory. The agent is the intermediary between vCenter and hostd. vCenter controls the ESXi host using this agent with the Virtual Provisioning X Daemon (VPXD) on the vCenter Server. The free version of ESXi does not include the vpxa agent.
vCenter uses a user 'vpxuser' to control the ESXi host. It does not need the root or dcui administrator accounts.
When vCenter shares a single vCenter Single Sign-On server, they can be linked using Enhanced Linked Mode. This allows vMotion across vCenters, management of other vCenters from one location. It's enhanced because it can link vCenters on different platforms (appliance and Windows, for example).
The PSC should be load balanced on external servers if it is used by multiple vCenters to avoid a single point of failure for multiple vCenters.
vCenter exposes an API to automate tasks.
Installation
Can be installed on Windows, Linux, or MacOS using their installer package. This requires at least one ESXi server already set up.
Once installed, the appliance will deploy onto the ESXi server and can later be managed using the VMware Appliance Management Interface (VAMI).
Clients
- vSphere (host) Client - Deprecated windows client
- vSphere Web Cleint (based on Adobe Flex/Flash)
- HTML5 - has 97% of features. vsphere advanced configuration not there yet. next version should be feature complete
ESXi Shell via SSH Use vSphere Power CLI
Always use vSphere to manage ESXi hosts.
Permissions
Permissions defines what user or group has access to what role and on what object. Users and groups can be local, or from an identity source.
Permissions on an object takes the following presidence:
- Explicit definitions on objects
- Definitions by groups
- Definitions by user
Migration
- vMotion across ESXi hosts, across datacenters, encrypted.
vRealize Orchestrator
vSphere Distributed Resource Scheduler (DRS)
- Across 64 ESXi hosts
Patch management using VMware vSphere Update Manager
Networking
- vSphere Distributed Switches (VDS)
- virtual switch for an entire data center, up to 2000 hosts - switch itself is saved on vCenter, and is created on each ESXi host as required - supports Link Aggregation Control Protocol (LACP) for teaming links
- vSphere Standard Switches (VSS)
- configuration only on one ESXi host.
Standard switch has the ability to move layer 2 traffic between virtual machines internally. ~256~ 4096 virtual switches per host, 1016 active ports per host
Connection types:
- virtual machine port group, used for virtual machines only
- vmkernel - used by the hypervisor; vMotion, iSCSI, NFS, or Fault Tolerance logging (and management on ESXi).
- port ID starts with 'vmk'. eg: vmk0
- uplink ports - connects to real NIC on the physical hardware
VMware recommends isolating management, vmotion, iSCSI, datastore traffic
Switches can have:
- No uplinks
- One uplink
- Multiple uplinks (automatically sets up NIC teaming)
Security Policies
Promiscuous mode: Forwards all switch traffic regardless of destination to this port. MAC Address Changes: Allow guest to modify MAC address of the virtual NIC. Forged Transmits: Accept traffic with frames that contain a different MAC address than that of the assigned NIC MAC address.
Traffic Shaping allows you to set bandwidth restrictions by specifying the average bandwidth or peak bandwidth (absolute maximum), with the option of burst bandwidth size. Outbound is free, but Inbound traffic shaping requires VDS which costs.
Teaming and failover - turn off notify if using Microsfot Network Load Balancing (NLB)
Snapshots
vmsd - snapshot descriptor file vmem - snapshot memory vmsn - memory snapshot -$delta.vmdk - disk delta
Templates
OVF - Open Virtualization File OVA - Open Virtualization Appliance
An existing VM that is used as a source copy (ie. master copy) for new VMs. A new template can be created from a powered down VM. The .vmx file gets renamed to a .vmtx file.
Content Library
A feature since 6.5 that allows VM templates to be shared across different vSphere.