Search This Blog

Removing Snapshots Can Cause VM Unresponsive

The first thing to remember is not to keep a VM snapshot for a long time – e.g. a few days for a busy VM. Because it

  • Can impact the VM performance and
  • Can cause the VM unresponsive when removing the snapshot (see KB1002836)

The second thing to remember is that removing or consolidating VM snapshots (particular a VM with a large snapshot file) when the VM is not busy.

Roll Back to A Previous Version of ESXi

Here are the steps to roll back to a perviouse version of ESXi: (source: KB1033604)

  1. Reboot the ESXi host
  2. When the hypervisor progress bar starts loading, press Shift + R.
  3. On the pop-up warning message “Current hypervisor will permanently be replaced with build: X.X.X-XXXXXX. Are you sure? [Y/n]”
  4. Press Shift + Y to roll back the build
  5. Press Enter to boot

Extend a Logical Drive in Windows Server 2008 R2

I recently successfully P2V a Windows Server 2008 R2 physical server to a vSphere VM. The server has two drives (Drive C and D), and both of drives were originally on one RAID 5 LUN. I didn’t know how the drives were originally created on the physical server, e.g.  whether Drive D is a primary partition or a logical drive on an extended partition.

When the Drive D starts low on the free disk space, I thought it’s very simple to extend a drive since the server is running Windows Server 2008.

  • I increase the size of hard disk 1 on the VM (both Drive C and D are on the hard drive) while the server is on
  • In Wndows Disk Management, rescan disks and then the extra unallocated disk space is showed
  • At this point, I noticed Drive D is a logical drive on an extended parition. I normally create the drive on the primary partition.
  • When right-click on the logical drive, the “Extend Volume” option is grayed out.
  • I had extended a non-OS drive in Windows Server 2008 via GUI before; and for Windows Server 2003, I had to use the diskpart utility.
  • Why I cannot extend this drive? Is it because it’s a logical drive on an extended partition? I’m not sure.
  • I know there are some third-party utilities can resize the partition. But I don’t have them handy.
  • Finally, I want to try the diskpart utility.
    • First, I tried extending the extended partition. It didn’t work. (see the yellow highlight)
    • Next, I tried extending the logical partition directly. It worked. (see the green highlight)

    C:\Windows\system32>diskpart

    Microsoft DiskPart version 6.1.7601
    Copyright (C) 1999-2008 Microsoft Corporation.
    On computer: AVLDB

    DISKPART> list disk

      Disk ###  Status         Size     Free     Dyn  Gpt
      --------  -------------  -------  -------  ---  ---
      Disk 0    Online          360 GB  1024 KB

    DISKPART> select disk 0

    Disk 0 is now the selected disk.
     
    DISKPART> list partition

      Partition ###  Type              Size     Offset
      -------------  ----------------  -------  -------
      Partition 1    OEM                 40 MB  1024 KB
      Partition 2    Primary           3072 MB    41 MB
      Partition 3    Primary             60 GB  3113 MB
      Partition 0    Extended           200 GB    63 GB
      Partition 4    Logical            200 GB    63 GB

    DISKPART> select partition 0

    Partition 0 is now the selected partition.

    DISKPART> extend

    There is no volume selected.
    Please select a volume and try again.

    DISKPART> list partition

      Partition ###  Type              Size     Offset
      -------------  ----------------  -------  -------
      Partition 1    OEM                 40 MB  1024 KB
      Partition 2    Primary           3072 MB    41 MB
      Partition 3    Primary             60 GB  3113 MB
    * Partition 0    Extended           200 GB    63 GB
      Partition 4    Logical            200 GB    63 GB

    DISKPART> select partition 4

    Partition 4 is now the selected partition.

    DISKPART> extend

    DiskPart successfully extended the volume.

NetScaler Packet Forwarding Flowchart

Source: Configuring Modes of Packet Forwarding

NetScaler Topologies Comparison

Source: Understanding Common Network Topolgies

Topology Two-Arm (inline)
Multiple Subnets Transparent
Client/Server IP on the different subnets on the same subnet
VIP public subnet no VIP
SNIP private subnet n/a
NSIP private subnet public subnet
MIP n/a public subnet
Server IP private subnet public subnet, configure the default gateway as the MIP
Layer 2 Mode n/a must enable
Use SNIP Option must enable n/a
Others the most commonly used topology if the clients need to access the servers directly
NetScaler is placed between the client and the server
Diagram
clip_image002[6]
clip_image004[6]
Task Overiew Task overview: To deploy a NetScaler appliance in two-arm mode with multiple subnets

1. Configure the NSIP and default gateway, as described in "Configuring the NetScaler IP Address (NSIP)."
2. Configure the SNIP, as described in "Configuring Subnet IP Addresses."
3. Enable the USNIP option, as described in "To enable or disable USNIP mode."
4. Configure the virtual server and the services, as described in "Creating a Virtual Server" and "Configuring Services."
5. Connect one of the network interfaces to a private subnet and the other interface to a public subnet.
Task overview: To deploy a NetScaler in two-arm, transparent mode

1. Configure the NSIP, MIP, and default gateway, as described in "Configuring a NetScaler by Using the Command Line Interface."
2. Enable L2 mode, as described in "Enabling and Disabling Layer 2 Mode."
3. Configure the default gateway of the managed servers as the MIP.
4. Connect the network interfaces to the appropriate ports on the switch.
Topology One-Arm
Single Subnet Multiple Subnets
Client/Server IP on the same subnet on the different subnets
VIP on the NetScaler on the NetScaler
SNIP n/a private subnet
NSIP public subnet private subnet
MIP public subnet n/a
Server IP public subnet private subnet
Layer 2 Mode n/a n/a
Use SNIP Option n/a must enable
Others connect one of the NICs to switch connect one of the NICs to switch
Diagram
clip_image002[8]
clip_image004[8]
Task Overiew Task overview: To deploy a NetScaler in one-arm mode with a single subnet

1. Configure the NSIP, MIP, and the default gateway, as described in "Configuring the NetScaler IP Address (NSIP)".
2. Configure the virtual server and the services, as described in "Creating a Virtual Server" and "Configuring Services".
3. Connect one of the network interfaces to the switch.
Task overview: To deploy a NetScaler appliance in one-arm mode with multiple subnets

1. Configure the NSIP and the default gateway, as described in "Configuring the NetScaler IP Address (NSIP)".
2. Configure the SNIP and enable the USNIP option, as described in "Configuring Subnet IP Addresses".
3. Configure the virtual server and the services, as described in "Creating a Virtual Server" and "Configuring Services".
4. Connect one of the network interfaces to the switch.

NetScaler Topologies Comparison

Source: Understanding Common Network Topolgies

Topology Two-Arm (inline) One-Arm
Multiple Subnets Transparent Single Subnet Multiple Subnets
Client/Server IP on the different subnets on the same subnet on the same subnet on the different subnets
VIP public subnet no VIP on the NetScaler on the NetScaler
SNIP private subnet n/a n/a private subnet
NSIP private subnet public subnet public subnet private subnet
MIP n/a public subnet public subnet n/a
Server IP private subnet public subnet, configure the default gateway as the MIP public subnet private subnet
Layer 2 Mode n/a must enable n/a n/a
Use SNIP Option must enable n/a n/a must enable
Others the most commonly used topology if the clients need to access the servers directly
NetScaler is placed between the client and the server
connect one of the NICs to switch connect one of the NICs to switch
Diagram
clip_image002
clip_image004
clip_image006
clip_image008

Extend a Linux LVM Volume on a VM - Part 3

This is the part 3 of extending a Linux LVM volume. see part 1 and part 2.

This part 3 is similar to part 2 when the partition as a PV. Instead of creating a new partition on the free disk space (like in part 2), delete the last partition on the disk and recreate it. This is useful when all the primary partitions (1 - 4) are already in use.

Extend a LVM when the partition as a PV

  1. Increase the VM’s hard disk size in vSphere Client

    • If there is a VM snapshot on the disk, its size cannot be changed. Remove all the snapshots first
    • After increasing the disk size, take a snapshot as the backup
  2. Rescan the SCSI bus to verify the OS see the new space on the disk
    • ls /sys/class/scsi_host/
    • echo “- - -“ > /sys/class/scsci_host/<host_name>/scan
    • tail -f /var/log/message
    • or
    • ls /sys/class/scsi_disk/
    • each ‘1’ > /sys/class/scsi_disk/<0\:0\:0\:0>/device/rescan
    • tail -f /var/log/message
    • fdisk -l
  3. Prepare the disk partition
    • fdisk -l
    • fdisk </dev/sdb>
    • p - print the partition table, note the last partition number in use
    • d - delete parition
    • p - primary partition
    • <X> - partition number, enter the last partition number from the previous p - print the partition table command 
    • n - add a new partition
    • p - primary partition
    • <X> - partition number, enter the partition number was deleted in the previous step 
    • default - the begining of the cylinder in the original partition
    • default - the last of the free cylinder
    • t - change a partition’s system id
    • <X> - partition number, enter the partition number was recreated in the previous step
    • 8e - Linux LVM
    • w - write table to disk and exit
    • fdisk -l to verify the new partition size
  4. Update partition table changes to kernel
    • reboot
    • or partprobe </dev/sdb>
    • Update (04/18/2016): In RHEL 6, partprobe will only trigger the OS to update the partitions on a disk that none of its partitions are in use (e.g. mounted). If any partition on a disk is in use, partprobe will not trigger the OS to update partition in the system because it it considered unsafe in some situations. So a reboot is required. see “How to use a new partition in RHEL6 without reboot?”
  5. Resize the PV
    • pvresize </dev/sdb3>
  6. Verifty the VG automatically sees the new space 
    • vgs
  7. Extend the LV
    • lvextend -l +100%FREE</dev/volume_group_name>/<logical_volume_name>
    • or lvextend -L+<size> /dev/<volume_group_name>/<logical_volume_name>
    • lvs
  8. Resize the file system
    • resize2fs /dev/<volume_group_name>/<logical_volume_name>
    • df -h
  9. Remove the VM snapshot once confirming the data intact

Use WinSCP to Transfer Files in vCSA 6.7

This is a quick update on my previous post “ Use WinSCP to Transfer Files in vCSA 6.5 ”. When I try the same SFTP server setting in vCSA 6.7...