Saturday 14 May 2016

vNetwork Distributed PortGroup (dvPortGroup) configuration

This article provides steps for configuring a Network Distributed PortGroup (dvPortGroup).


To modify and add dvPortGroups:

In vCenter, go to Home > Inventory > Networking.
Right-click dvPortGroup and click Edit Settings.
Under dvPortGroup Settings, specify:
General
Policies
Security
Traffic Shaping
VLAN
Teaming and Failover
Resource Allocation
Monitoring
Miscellaneous
Advanced

Under the General Settings, define:
The name of the portgroup
A description
The number of ports available
The type of Port Binding:

Static Binding (Default): This means that the dvPort is assigned to the virtual machine at configuration time. When all the ports are booked by virtual machines, it is not possible to connect to any more virtual machines, regardless of whether the connected virtual machines are powered up or not, and an error message is displayed.

Dynamic Binding: This means that the dvPort is assigned at the moment of powering the virtual machine up. This option allows for over-committing the number of dvPorts.

Note: Dynamic Binding is deprecated in ESXi 5.0. For more information, see the vSphere Networking guide for  ESXi 5.0.

None (Ephemeral ports): (Ephemeral Ports or No Binding) This behavior resembles the behavior in the standard vSwitch. If you select this option, the number of ports are automatically set to 0, and the Portgroup allocates one port for each connected virtual machine, up to the maximum number of ports available in the Switch.

Setting Security:
Promiscuous mode: Allows virtual adapters connected to this dvPortgroup to see all frames passed on the host proxy switch that are allowed under the VLAN policy for the dvPortgroup
Mac address changes: Allows virtual machines to receive frames with a Mac Address that is different from the one configured in the VMX.
Forged Transmits: Allows virtual machines to send frames with a Mac Address that is different from the one specified in the VMX.

Traffic Shaping policies:

Note: Allows you to define ingress and egress traffic shaping.

Ingress shaping is a new feature, and available only with dvSwitch (not on vSwitch).

Traffic Shaping concepts:
Average Bandwidth: Target traffic rate cap that the switch tries to enforce. Every time a client uses less than the defined Average Bandwidth, credit builds up.
Peak Bandwidth: Extra bandwidth available, above the Average Bandwidth, for a short burst. The availability of the burst depends on credit accumulated so far.
Burst Size: Amount of traffic that can be transmitted or received at Peak speed. By combining Peak Bandwidth and Burst Size, you can calculate the maximum allowed time for the burst.

VLAN EST Policies:

Note: Allows you to specify the VLAN behavior of only the dvSwitch.

EST: External Switch Tagging
NONE: Physical equivalent to: No VLAN Tagging
Standard vSwitch equivalent to: VLAN ID option set to 0

VLAN VST Policies:
VST: Virtual Switch Tagging
VLAN: Physical equivalent to: VLAN in Access/Untagged mode
Standard vSwitch equivalent to: VLAN ID option
VLAN ID 4095 is not allowed here

VGT Policies:
VGT: VLAN Guest Tagging
VLAN Trunking: Physical equivalent to: VLAN in Trunk/Tagged mode
Standard vSwitch equivalent to: VLAN ID set to 4095
vDS Only: option to specify the range of VLANs to trunk, to improve security

PVLAN Policies:
PVLAN Physical equivalent to: PVLAN
Standard vSwitch equivalent to: Does not exist
PVLAN option to specify which Primary and Secondary VLAN to use (Selecting from the list defined in the Switch)

Teaming and Failover Policies:
Load Balancing
Failover detection
Notify Switches
Failback
Failover order
Specific Uplink usage

Miscellaneous Policies:
Allows you to block all the dvPorts of the dvPortgroup.

Resource Allocation:
Allows a user-defined Network Resource Pool to be associated with the dvPortgroup.

Note: Network Resource Pools is a new feature and available only with the ESXi 5.0 version of dvSwitch (not available with vSwitch or earlier versions of dvSwitch).

Monitoring:
Allows NetFlow to be enabled for the dvPortGroup.

Note: NetFlow is a new feature which is available only with the ESXi 5.0 version of dvSwitch (not available with vSwitch or earlier versions of dvSwitch).

The dvPortgroup Advanced subcategory is different from dvSwitch:
This allows each individual dvPort to override the settings of the dvPortgroup.
By clicking Edit Override Setting, the VI Admin can also specify which properties to allow/not allow to be overridden at lower levels

Monday 11 April 2016

Reducing the size of the VMware Virtual Machine Disk

Reducing the size of the VMware Virtual Machine Disk (VMDK)


Login and connect to the VMware vSphere Host ESXi server which hosts the virtual machine.

Power OFF the Virtual Machine, and change to the datastore path where the VMware virtual machine disk (VMDK) is located.

cd /vmfs/volumes/<datastore name>/<VM foldername>
VM Folder PathWe need to edit the *.vmdk, which is the descriptor file, which contains the variables for the size of the *.-flat.vmdk. Using cat, this is what the descriptor file contains
VMDK Descriptor fileThe number highlighted above, under the heading #Extent description, after the letters RW, defines the size of the VMware virtual disk (VMDK).

this number - 83886080, and it's calculated as follows:

40 GB = 40 * 1024 * 1024 * 1024 / 512  =  83886080

We wanted to reduce the size of the VMware virtual machine disk (VMDK) from 40 GB to 20 GB. So the value we need to enter into the descriptor file is:-

20 GB = 20 * 1024 * 1024 * 1024 / 512  =  41943040

Using vi, edit the descriptor file, and change the number from 83886080 to 41943040, and save the file.
VMDK Edited with viMigrate or Copy the virtual machine to another datastore.

After the virtual machine disk (VMDK) has been moved, you will notice the disk size reflects the desired size of 20GB.
Size of virtual disk, as viewed from vSphere ClientSize of virtual disk as viewed from consoleAfter restarting the virtual machine, and checking with Disk Management, you will notice the 19.5GB unallocated storage space, has been removed, and disappeared.
Size of virtual disk as viewed from Disk Management in the OS
you have successfully Shrunk a VMware Virtual Machine Disk (VMDK)