Monday, April 28, 2014

Installing software package by PowerShell 5.0 in Windows Server 2012 R2

Microsoft announced Windows Management Framework 5.0 preview (WMF 5.0) for Windows Server 2012 R2 and Windows 8.1. One of the features is "OneGet" module. "OneGet" is similar to a feature "YUM" or "APT" in Linux. Using "OneGet", administrators can perform PowerShell to download and install software packages from internet repository. In this preview version, all source packages are from "Chocolatey".

To use cmdlets to download and install package, make sure the operating systems are supported. At this moment, Windows Management Framework 5.0 Preview supported Windows 8.1 Pro, Windows 8.1 Enterprise and Windows Server 2012 R2. Microsoft also listed the application which are supported WMF 5.0.
  • Microsoft Exchange Server 2013 Service Pack 1
  • Microsoft Exchange Server 2010 Service Pack 3 with Update Rollup 5
  • Microsoft SharePoint Server 2013 Service Pack 1
  • Microsoft SharePoint 2013 with the February 2014 Cumulative Update

This is the preview version. Administrators shouldn't test it in production environment.

Lab environment
  • 1 Windows Server 2012 R2 with update 1
Prerequisite
  • Download Windows Management Framework 5.0 Preview and then save as C drive in a Windows Server

Download link

Lab
1. On a  Windows Server, log in as administrator.
2. Navigate to C drive.
3. Double-click "Windows8.1-KB2894868-x64" to install Windows Management Framework 5.0 64 bit version.


4. Launch "PowerShell" as administrator.
5. Perform "Get-Command -Module OneGet' to get commands related to OneGet module.


Like "Yum" or "APT", administrators can add or remove the package repository by performing "Add-PackageSource" and "Remove-PackageSource". Administrators can perform "Get-PackageSource" to get the other package repositories sites from Internet. At this moment, there is only one repository, "Chocolatey".


5. Perform "Find-Package" to find all packages from the repository.


At this moment, there are almost 1800 software packages on the repository

6. Perform "Install-Package 7zip" to download and install "7zip".



"Install-Package" automatically download and install the dependency package of the software which you want to install.

7. Perform "Get-Package" to check which package were installed by "OneGet" PowerShell module.


8. Perform "Uninstall-Package 7zip" to uninstall 7zip package.


To get more details of "OneGet" module, please read this article PowerShell - Playing with the new OneGet module (v5 preview) is written by Francois-Xavier Cat.

For more information

This posting is provided “AS IS” with no warranties, and confers no rights!

Friday, April 25, 2014

Configure Storage Tiers on Windows Server 2012 R2 by PowerShell

Administrators can configure Storage Tiers by GUI in Windows Server 2012 R2. However, administrators cannot configure the write-back cache size through GUI. Plus, administrators may want to test it in a test environment. For some reasons, administrators should perform PowerShell to configure Storage Tiers.

Lab environment
  • 1 SSD with 100GB and 2 HDD with 500GB are installed in HV01

Goal
  • Create Storage Tier with a simple virtual hard disk in HV01 by PowerShell
Lab
1. On HV01, log in as administrator.
2. Launch "PowerShell" as administrator.
3. Perform "Get-PhysicalDisk -CanPool $True" to check the disks which can be added to a storage pool.


4. Perform "New-StoragePool -FriendlyName DiskPool-01 -StorageSubSystemFriendlyName (Get-StorageSubSystem).FriendlyName -PhysicalDisks (Get-PhysicalDisk -CanPool $True)" to create a new storage pool named DiskPool-01.


5. Perform "Get-StoragePool DiskPool-01 | Get-PhysicalDisk | Select FriendlyName,MediaType" to verify the media type of disks.


6. Perform "Get-StoragePool DiskPool-01 | New-StorageTier -FriendlyName SSDTier -MediaType SSD" to create SSD Tier for "DiskPool-01" storage pool.
7. Perform "Get-StoragePool DiskPool-01 | New-StorageTier -FriendlyName HDDTier -MediaType HDD".


To check the storage tier supported size for "Simple" or "Mirror" types, administrators can perform "Get-StorageTierSupportSize -FinedlyName *SSD* -ResiliencySettingName <Type>".



8. Perform "$SSD = Get-StorageTier -FriendlyName SSDTier" to store the SSD tier to a variable.
9. Perform "$HDD = Get-StorageTier -FriendlyName HDDTier" to store the HDD tier to a variable.
10. Perform "Get-StoragePool DiskPool-01 | New-VirtualDisk -FriendlyName vDisk01 -ResiliencySettingName Simple -StorageTiers $SSD, $HDD -StorageTierSizes 20GB, 80GB -WriteCacheSize 5GB" to create a new virtual disk which is named vDisk01 and then the size of vDisk01 is 100GB. We also assign 5GB write-back cache for this virtual disk.


Remark: "Write-back cache" option only can by applied by PowerShell.

11. Perform "Initialize-Disk -VirtualDisk (Get-VirtualDisk -FriendlyName vDisk01) -PartitionStyle GPT" to initialize the virtual hard disk.


12. Perform "New-Partition -DiskNumber 8 -UseMaximumSize -DriveLetter D" to create a new partition.


13. Perform "Format-Volume -DriveLetter D -FileSystem NTFS -Confirm:$false".


Using PowerShell, administrators can assign files to SSD tier by performing the following cmdlets.

1. Perform "Get-VirtualDisk -FriendlyName vDisk01 | Get-StorageTier" to check the  existing Storage Tier name of the virtual hard disk.


2. Perform "Set-FileStorageTier -FilePath <File Path> -DesiredStorageTierFriendlyName vDisk01_SSDTier" to assign the file to SSD Tier.


3. Perform "Get-FileStorageTier -VolumeDriveLetter <Drive letter name>" to verify the file in which tier.


Testing in a virtual machine environment
You can also follow the article, Why R2? Step-by-Step: Automated Tiered Storage with Windows Server Server 2012 R2, which was written by Keith Mayer to test Storage Tiers in a virtual machine environment.

For more information:




This posting is provided “AS IS” with no warranties, and confers no rights!

Thursday, April 24, 2014

Configuring Storage Tiers on Windows Server 2012 R2 by GUI

Microsoft added a new function, storage tiers, in existing storage pool function in Windows Server 2012 R2.

With Storage tiers, you can create virtual disks that are comprised of two tiers of storage:
  • Solid-state drive tier for frequently accessed data
  • Hard disk drive tier for less-frequently accessed data
Storage Spaces transparently moves data at a subfile level between the two tiers, based on how frequently data is accessed.

What value does this change add?

Storage tiers combine the best attributes of solid-state drives and hard disk drives. They increase the performance of the mist used ("hot") data by moving it to solid-state drives, without sacrificing the ability to store large quantities of data on inexpensive hard disks.

Quote from What's New in Storage Spaces in Windows Server 2012 R2

Lab environment
  • 1 SSD with 100GB and 2 HDD with 500GB are installed in HV01

Goal
  • Create Storage Tier with a simple virtual hard disk in HV01 by GUI

Lab
1. On HV01, log in as administrator.
2. Launch "Server Manager".
3. On "Server Manager" window, click "File ans Storage Services".



4. Select "Storage Pools".



5. Next to "TASKS" of "STORAGE POOLS", click "New Storage Pool".



6. On "Before You Begin" window, click "Next".
7. On "Storage Poo Name" window, next to "Name", enter "DiskPool-01".



8. Click "Next".
9. On "Physical Disks", check all Physical Disks.



10. Click "Next".
11. On "Confirmation" window, click "Create".



12. On "Results" window, click "Close".
13. On "Server Manager", next to "VIRTUAL DISKS", click "To create a virtual disk, start the New Virtual Disk Wizard".



14. On "Before You Begin" window, click "Next".
15. On "Storage Pool" window, select "DiskPool-01", click "Next".



16. On "Virtual Disk Name" window, next to "Name", enter "vDisk01".
17. Check "Create storage tiers on this virtual disk".



18. Click "Next".
19. On "Storage Layout" window, select "Simple", click "Next".



Remark: Storage Tiers support "Two-way mirror" and "Three-way mirror". However, administrators have to add additional disks in servers.

20. On "Provisioning" window, click "Next".



21. On "Size" window, select "Maximum size" for "Faster Tier (SSD)" and "Standard Tier (HDD)".



22. Click "Next".
23. On "Confirmation" window, click "Create".



24. On "Results" window, leave default setting, click "Close"



25. On "Before You Begin" window, click "Next".
26. On "Server and Disk" window, select "Disk 8", click "Next".



27. On "Size" window, leave default volume size, click "Next".



28. On "Drive Letter or Folder' window, leave default drive letter, click "Next".



29. On "File System Settings" window, leave default settings, click "Next".



30. On "Confirmation" window, click "Create".



31. On "Results" window, click "Close".



It's easy for administrators to configure Storage Tiers through GUI in Windows Server 2012 R2. However, some settings like "Write-back cahe" and assign files to SSD tier must be performed by PowerShell.

Restore settings
1. On "Disks" of "Server Manager", next to "DISKS", select "vDisk01".
2. Next to "VOLUMES", right-click "D:", select "Delete Volume".



3. On "Delete Volume" window, click "Yes".



4. Go to "Storage Pools" of "Server Manager".
5. Next to "VIRTUAL DISKS", right-click "vDisk01", select "Delete Virtual Disk".



6. On "Delete Virtual Disk" window, click "Yes".


7. Next to "STORAGE POOLS", right-click "DiskPool-01", select "Delete Storage Pool".



When configuration completed, the storage tires related schedule jobs will change the status to "Ready".



For more information:
What's New in Storage Spaces in Windows Server 2012 R2

Storage Spaces: How to configure Storage Tiers with Windows Server 2012 R2

What's New in Defrag for Windows Server 2012/2012R2

This posting is provided “AS IS” with no warranties, and confers no rights!

Tuesday, April 22, 2014

Enabling virtual receive-side scaling (vRSS) in Windows Server 2012 R2 virtual machine

In Windows Server 2012 R2, Microsoft added the receive-side scaling function in a Microsoft Hyper-V Network Adapter of a virtual machine. This function is called virtual receive-side scaling by Microsoft. By default, receive-side scaling in a virtual machine is disabled.  



Before using virtual receive-side scaling, the network throughput of a virtual machine is limited by a single virtual processor because a single virtual processor isn't enough processing power to handle the network throughput larger than 5Gb. Microsoft improved virtual machine queue to work with virtual receive-side scaling in Windows Server 2012 R2. The network traffic of a virtual machine which is enabled vRSS will spread to multiple VMQ. It can improve the network performance of a virtual machine.

To use virtual receive-side scaling, administrators make sure the following items are supported.

  • Operating system of a virtual machine is Windows Server 2012 R2 or Windows 8.1
  • The Hyper-V host is Windows Server 2012 R2
  • Windows Server 2012 R2 integration components is installed in a virtual machine
  • A physical network adapter supports Virtual Machine Queue (VMQ)
To enable virtual receive-side scaling, administrators can enable it by "Device Manager" or "PowerShell" in a virtual machine which is installed Windows Server 2012 R2.

Device Manager 
1. On a virtual machine, log in as administrator.
2. Click "Start", enter "device manager".


3. Expand "Network adapters".
4. Right-click "Microsoft Hyper-V Network Adapter", select "Properties".


5. Select "Advanced" tab.
6. Select "Receive Side Scaling".
7. Next to "Value", select "Enabled".


8. Click "OK".

PowerShell
1. On a virtual machine, log in as administrator.
2. Launch "PowerShell" as administrator.
3. Perform "Set-NetAdapterRss -Name <NIC Name> -Enabled $True" to enable RSS on a network adapter.


Remark: Administrators also can assign how many virtual processors for virtual receive-side scaling (vRSS). For more information, please read Receive Side Scaling (RSS) in Windows Server 2012 and Windows Server 2012 R2.

To disable virtual receive-side scaling, administrators can perform "Set-NetAdapterRss -Name <NIC Name> -Enabled $False".


More information:

This posting is provided “AS IS” with no warranties, and confers no rights!