星期四, 5月 14, 2015

20150514-vSphere6-ICM-Day4

20150514-vSphere6-ICM-Day4

Lesson 3: Migrating Virtual Machines

Migrating Virtual Machines
Types of migrations
  • Cold
    • Migrate a virtual machine that is power off.
  • Suspended
    • Migrate a virtual machine that is suspended
  • vMotion
    • Migrate a virtual machine that is power on
  • vSphere Storage vMotion
    • Migrate a virtual machine’s files, while the virual machine is powered on, to a different datastore.
Cross-Host vMotion = vMotion + Storage vMotion

Comparison of Migration Types
  • 目前vSphere 6 Migration 都可以跨 vCenter Servers

How vSphere vMotion Migration Works
vMotion 的必要條件
  • 要有 shared storage
  • 要有vMotion Network ( 如果是長距離的 vMotion 不可以用預設的VMkernel Port, 要使用 vMotion 專用 )
  • Virtual Machine Port Group

Notes:
  • 同一台主機同時只能做兩個 Storage vMotion 或是 8 個 vMotion, ( 但是如果同時有進行vMotion 以及 Storge vMotion 就是 2 Storage vMotion + vMotion 與 6 vMotion )

vSphere vMotion Migration Requirements
  • 不可以有 internal vSwitch(沒有 uplink 的vSwitch)
  • 不可以連接到 virtual device ( such as a CD-ROM or floppy)
  • A virtual machine must not have CPU affinity configured.( 不可以指定CPU)
  • swap 必須被目的地主機存取的到
  • If a virtual machine uses an RDM, the RDM must be accessible by the destination host.

vSphere Storage vMotion in Action
  • 如果有支援 VAAI ( Enterprise  版本以上 ) 那就可以在Storage  直接搬移, 如果是 Standard 版本則是利用 ESXi 上的 Data Mover 來搬動, 有效能的差異.

Cross-Host vSphere vMotion
  • 必須使用 Web Client 才能操作

Migration Between vCenter Server Instances
This type of migration requires:
• • •
  • ESXi hosts and vCenter Server systems must be upgraded to vSphere 6.
  • vCenter Server instances must be in Enhanced Linked Mode.
  • Hosts must be time-synchronized.

vSphere vMotion TCP/IP Stacks
In vSphere 6, each host has a second TCP/IP stack dedicated to vSphere vMotion migration.

Network Checks for Migrations Between vCenter Server Instances
vCenter Server performs several network compatibility checks to prevent the following configuration problems:
  • •MAC address compatibility on the destination host
  • vSphere vMotion migration from a distributed switch to a standard switch
  • vSphere vMotion migration between distributed switches of different versions
  • •vSphere vMotion migration to an internal network, for example, a network without a physical NIC


Lab 14: Migrating Virtual Machines
  • 進行 storage vMotion
  • 建立 vSwitch 以及 VMkernel port group
  • 執行 vMotion
  • 執行 Cross-Host vSphere Storage vMotion


Lesson 4: Creating Virtual Machine Snapshots

Remove VM
  • Remove from Inventory
  • Delete from Disk


Lesson 5: Creating vApps

Managing Virtual Machines with a vApp

Create vApp
  • Standalone Host
  • DRS cluster

A vApp:
  • Is a container for one or more virtual machines
  • Can be used to package and manage related applications.


Lab 15: Managing Virtual Machines
Lab 16: Managing vApps


-- 上午課程結束 --

下午處理公事無法上課  Orz….

-- Class End --

星期三, 5月 13, 2015

20150513-vSphere6-ICM-Day3

20150513-vSphere6-ICM-Day3

Lesson 2: iSCSI Storage
iSCSI Addressing
  • iqn名稱 或 eui 名稱 + iSCSI alias + IP address

iSCSI Initiator
  • software iSCSI
    • 利用一般網卡
    • VMkernel 模擬
  • dependent hardware iSCSI
    • 可以支援 一般網卡及iSCSI 功能
    • 需要 ESXi 主機輔助
    • A dependent hardware iSCSI initiator, or adapter, depends on VMware networking and on iSCSI configuration and management interfaces that are provided by VMware.
  • independent hardware iSCSI
    • 實體介面卡
    • VMkernel使用 iSCSI HBA driver
    • An independent hardware iSCSI adapter handles all iSCSI and network processing and management for your ESXi host.

ESXi Network Configuration for IP Storage

Software initiator 設定步驟
  1. VMkernel port IP Address 設定
  2. Enable Software iSCSI initiator
    1. optional ( 如果 initiator 與 target 名稱不一樣開頭,  就要修改名稱 )
  3. Port binding ( 確認路由, 為了未來的 MultiPath )
  4. Discovery iSCSI target
  5. optional ( CHAP )

Creating Datastores and Discovering iSCSI Targets
The ESXi host supports two iSCSI target-discovery methods:
  • Static discovery
    • The initiator does not have to perform discovery. The initiator knows in advance all the targets that it will contact and uses their IP addresses and domain names to communicate with them.
  • Dynamic discovery
    • Also called SendTargets discovery. Each time the initiator contacts a specified iSCSI server, it sends the SendTargets request to the server.
  • 透過 3260 port 來discovery

iSCSI Security: CHAP
ESXi supports the following CHAP authentication methods:
  • Unidirectional: Also called one-way CHAP. The target authenticates the initiator, but the initiator does not authenticate the target. You must specify the CHAP secret so that your initiators can access the target.
  • Bidirectional: Also called mutual CHAP. An additional level of security enables the initiator to authenticate the target. You must specify different target and initiator secrets.
  • 預設 CHAP 不啟用

Software iSCSI only
  • Bidirectional CHAP
  • Per-target CHAP

Multipathing with iSCSI Storage
  • 在ESXi 上面只能啟用一張 Software Initiator
Software or dependent hardware iSCSI:
  • •Use multiple NICs.
  • •Connect each NIC to a separate VMkernel port.
  • •Associate VMkernel ports with the iSCSI initiator.
Hardware iSCSI:
  • •Use two or more hardware iSCSI adapters.

Lab 9: Accessing iSCSI Storage
  • 新增 VMkernel Port Group
  • 設定 iSCSI

Lesson 3: NFS Datastores

Configuring an NFS Datastore
  • Create a VMkernel port: •
    • For better performance and security, separate it from the iSCSI network.
  • Provide the following information:
    • NFS version: v3 or v4.1
    • NFS server names or IP addresses
    • Folder on the NFS server, for example, /templates and /nfs_share
    • Host to create the datastore on
    • Whether to mount the NFS file system read-only ( 決定掛載方式, rw or ro )
    • Datastore name
    • Authentication parameters

NFS v3 and NFS v4.1
NFS v3:
  • ESXi managed multipathing
  • AUTH_SYS (root) authentication
  • VMware proprietary file locking
  • Client-side error tracking

NFS v4.1:
  • Native multipathing and session trunking
  • Optional Kerberos authentication
  • Built-in file locking
  • Server-side error tracking


NFS Version Compatibility with Other vSphere Technologies
  • As of the release of vSphere 6, NFS v4.1 is not compatible with VMware vSphere Storage DRS, vSphere Storage I/O Control, VMware vCenter Site Recovery Manager, and Virtual Volumes, because of server protocol locking.

NFS Dual Stack Not Supported
NFS v3 locking is not compatible with NFS v4.1:
  • •NFS v3 uses proprietary client-side cooperative locking. NFS v4.1 uses server- side locking.
Best practice:
  • •Configure an NFS array to allow only one NFS protocol.
  • •Use either NFS v3 or NFS v4.1 to mount the same NFS share across all ESXi hosts.
  • •Mounting an NFS share as NFS v3 on one ESXi host and as NFS v4.1 on another ESXi host can lead to data corruption.

Multipathing and NFS Storage
One recommended configuration for NFS multipathing:
  • •Configure one VMkernel port.
  • •Use adapters attached to the same physical switch to configure NIC teaming.
  • •Configure the NFS server with multiple IP addresses:
    • –IP addresses can be on the same subnet.
  • •To use multiple links, configure NIC teams with the IP hash load- balancing policy.

Lab 10: Accessing NFS Storage
  • 建立 NFS datastore

-- Class break --

Lesson 4: VMFS Datastores

Using VMFS Datastores with ESXi Hosts
Use VMFS datastores whenever possible:
  • VMFS is optimized for storing and accessing large files.
  • A VMFS datastore can have a maximum volume size of 64 TB.
Use RDMs if the following conditions are true of your virtual machine:
  • It is taking storage array-level snapshots.
  • It is clustered to a physical machine.
  • It has large amounts of data that you do not want to convert into a virtual disk.
NFS not support
  • Boot from SAN
  • RDM

Managing Overcommitted Datastores
A datastore becomes overcommitted when the total provisioned space of thin-provisioned disks is greater than the size of the datastore.
Actively monitor your datastore capacity:
  • Alarms assist through notifications: –
    • Datastore disk overallocation ( 監控 overallocation 百分比, 例如 300% )
    • Virtual machine disk usage
Actively manage your datastore capacity:
  • Increase the datastore capacity when necessary.
  • •Use VMware vSphere Storage vMotion to mitigate space usage problems on a particular datastore.

Notes:
  • 這個部分可以在 Alarms 新增 Datastore disk provisioned 可以監控 overcommitted 狀況
  • 觀察的話, 透過 Datastore 內的 Monitor -- > Performance -- > Space in GB 去看使用狀況

Increasing the Size of a VMFS Datastore
Ways to dynamically increase the size of a VMFS datastore:
  • •Add an extent (LUN). (將兩個 LUN 合併)
  • Expand the datastore within its extent. ( 垂直擴充1個 LUN )
You can expand but you can not shrink a VMFS datastore.

Deleting or Unmounting a VMFS Datastore
Before you unmount a VMFS datastore, use the vSphere Web Client to verify the following:
  • No virtual machines reside on the datastore.
  • The datastore is not part of a datastore cluster (not discussed in this course).
  • The datastore is not managed by vSphere Storage DRS.
  • Storage I/O Control is disabled.
  • The datastore is not used for vSphere HA heartbeat.

Multipathing Algorithms

vSphere 6 offers native path selection, load-balancing, and failover mechanisms.
An ESXi host can be attached to storage arrays with a storage processor configuration of:
  • •Active-active
  • •Active-passive

Configuring Storage Load Balancing

Scalability:
  • Round Robin
Availability:
  • MRU ( Most Recently Used)常用 Active – passive(Standby) storage device ( 故障修復之後不會切換回來 )
  • Fixed 固定 ( Failback ) Active – Active storage device ( 故障修復之後會切換回來 )

-- 上午課程結束 --

Lab 11: Managing VMFS Datastores
  • Rename VMFS Datastore
  • 建立 VMFS Datastore
  • Expend VMFS Datastore
  • Remove a VMFS Datastore
  • Extend VMFS Datastore


Lesson 5: Virtual SAN Datastores

About Virtual SAN

VSA ( vSphere Storage Appliance )
  • 5.0 版本有
  • NFS
  • 需要  2  到 3 台 host

VSAN ( vSphere virtual SAN )
  • 3 - 64 台Host
  • 要有 SSD + HD

Virtual SAN Requirements
Network
  • 1GB or 10GB
Controller
  • SAS/SATA: RAID controller must work in passthrough or HBA mode
Cache
  • PCI/SAS/SATA SSD
  • At least 1 of each
Data
  • PCI/SAS/SATA  HD/SSD
  • At least 1 of each

Using Virtual SAN

  • VM Storage Policies are what you configure so that a virtual machine can take advantage of Virtual SAN storage.( 設定Datastore 關聯性 )
  • Capabilities define the capacity, performance, and availability characteristics of the underlying physical storage.

vSphere Storage API
  • VASA (vStorage API for Storage Awareness)
  • VAAI ( vStorage APIs for Array Integration )
  • VADP ( vStorage APIs for Data Protection )


Lesson 6: Virtual Volumes

Protocol Endpoints
  • The protocol endpoint is set up by the storage administrator.
  • The protocol endpoint is part of the physical storage fabric. It is treated like a LUN.
  • The protocol endpoint supports typical SCSI and NFS commands.
  • Virtual volumes are bound and unbound to a protocol endpoint: ESXi or VMware vCenter Server™ initiates the bind and unbind operation

Storage Containers
In vCenter Server, the storage containers are represented by virtual datastores:
  • •A storage container is configured by the storage administrator.
  • •A storage container is a logical grouping of virtual volumes.
  • •A storage container’s capacity is limited only by the hardware capacity.
  • •You must set up at least one storage container per storage system. You can have multiple storage containers per array.
  • •You assign capabilities to storage containers.

-- Class break --

** MODULE 7 Virtual Machine Management **

Lesson 1: Creating Templates and Clones

Creating a Template
  • Clone to Template
    • 從VM 複製成Template
    • VM 不必要關機
  • Convert to Template
    • VM必須關機
  • Clone a template:
    • Used to create a new template based on one that existed previously.

Notes:
Template 與 VM 的差異
  • vmtx 與 vmx

Deploying a Virtual Machine from a Template
  • To deploy a virtual machine, you must provide such information as the virtual machine name, inventory location, host, datastore, and guest operating system customization data. ( 呼叫 sysprep 或是其他的程式來客製化 VM )

Updating a Template

Update a template to include new patches, make system changes, and install new applications:
1.Convert the template to a virtual machine.
2.Place the virtual machine on an isolated network to prevent user access.
3.Make appropriate changes to the virtual machine.
4.Convert the virtual machine to a template.
將範本轉成VM 然後進行變更( 更新 ), 再轉回範本

Cloning a Virtual Machine
  • 應用在 Lab 環境或是 patch 測試

Customizing the Guest Operating System

Windows
  • 使用 Microsoft Sysprep
  • 設定 customizing
    • 輸入相關資訊
Notes:
  • Windows 7 以後已經內建 sysprep,  所以應該不用特別將 sysprep tool 複製到vCenter


Lab 12: Using Templates and Clones
  • 建立範本
  • Create Customization Specification
  • 從範本建立VM
  • Clone a Powered-On Virtual Machine


Lesson 2: Modifying Virtual Machines

Hot-Pluggable Devices
CPU and memory can also be added while the virtual machine is powered on. This feature is called the CPU hot-plug and memory hot-add option. These options are disabled by default. To use these hot-plug features:
  • You must install VMware Tools.
  • The virtual machine must use hardware version 7 or later.
  • The guest operating system in the virtual machine must support CPU and memory hot-plug features.
  • The hot-plug options must be enabled in the VM Options tab of the Edit Settings dialog box.

Creating an RDM

An RDM supports two compatibility modes:
  • Physical compatibility (pass-through) mode: Allows the guest operating system to access the hardware directly.
  • Virtual compatibility mode: Allows the virtual machine to use VMware snapshots and other advanced features.

Inflating a Thin-Provisioned Disk
  • 把 Thin Provision 變成 thick, eager-zeroed  格式
  • VM 必須關機
  • 在VM的  .vmdk檔案上面按滑鼠右鍵, 選擇 Inflate


Lab 13: Modifying Virtual Machines
  • 增加 VMDK 大小
  • 調整VM記憶體
  • Rename VM
  • 新增/移除 Raw LUN
  • Expend a Thin-Provisioned Virtual Disk


-- Class End --