Sunday, October 28, 2012

Microsoft Virtual Machine Converter

Microsoft release a new free tool, "Microsoft Virtual Machine Converter (MVMC)". It allows administrators converting a VMware-based virtual machines and vmdk disks to Hyper-V based virtual machines and VHD disks.

MVMC supports to convert a virtual machine from VMware vShpere 4.1, 5.0 to Windows Server 2012, Windows Server 2008 R2 SP1, Microsoft Hyper-V Server 2012 and Microsoft Hyper-V Server 2008 R2 SP1.

Remark: To convert a virtual machine from VMware vShpere 4.0, you have to connect to vCenter 4.1 or 5.0 through MVMC to convert a virtual machine on vSphere 4.0.

The following operating systems are supported to be converted.
  • Windows Server 2003 Standard Edition with SP2 x86 
  • Windows Server 2003 Standard Edition with SP2 x64
  • Windows Server 2003 Enterprise Edition with SP2 x86
  • Windows Server 2003 Enterprise Edition with SP2 x64
  • Windows Server 2003 R2 Standard Edition with SP2 x86 
  • Windows Server 2003 R2 Standard Edition with SP2 x64
  • Windows Server 2003 R2 Enterprise Edition with SP2 x86
  • Windows Server 2003 R2 Enterprise Edition with SP2 x64
  • Windows Vista Enterprise x86
  • Windows Vista Enterprise x64
  • Windows 7 Professional x86
  • Windows 7 Professional x64
  • Windows 7 Enterprise x86
  • Windows 7 Enterprise x64
  • Windows 7 Ultimate x86
  • Windows 7 Ultimate x64
  • Windows Server 2008 Enterprise x86
  • Windows Server 2008 Enterprise x64
  • Windows Server 2008 Datacenter x86
  • Windows Server 2008 Datacenter x64
  • Windows Server 2008 R2 Standard
  • Windows Server 2008 R2 Enterprise
  • Windows Server 2008 R2 Datacenter

I will try to use MVMC to convert a virtual machine from ESXi 4.1 to Windows Server 2012 Hyper-V environment.

Lab environment
  • 1 ESXi 4.1 server
  • 1 Windows Server 2012 with Hyper-V named HVSVR02 joined test.contoso.com domain
  • 1 Windows 7 named WS01 installed vSphere Client and join test.contoso.com domain
Goals
Convert a VM which is installed Windows Server 2003 from ESXi 4.1 to Windows Server 2012 Hyper-V environment.

Prerequisites

Converting a VM by Microsoft Virtual Machine Converter Solution Accelerator
1. On WS01, log in as Domain Administrator.
2. To install "Microsoft Virtual Machine Converter Solution Accelerator" in Windows 7 and Windows Server 2008 R2, you need to install Microsoft .NET Framework 3.5 and .NET Framework 4.0 in WS01.

Remark: If you install "Microsoft Virtual Machine Converter Solution Accelerator" in Windows Server 2012, I need to install Microsoft .NET Framework 4.5.

3. Install "Microsoft Virtual Machine Converter Solution Accelerator" in WS01.
4. Launch "Virtual Machine Converter".


5. On "Before You Begin" window, click "Next".
6. On "Source" window, next to "Address", type the IP address or DNS name of the ESXi server.
7. Provide the "User name" and "Password" of the ESXi server.



8. Click "Next".
9. On "Virtual Machines" window, select the VM which you want to convert.


Remark: If the VMware tools isn't installed in the VM, the VM cannot be converted.

Remark: If the VM isn't running, the VM cannot be converted.


10. Click "Next".
11. On "Connection" window, un-check "Use my Windows user account".
12. Provide the local administrator "User name" and "Password" of the VM which is installed Windows Server 2003.

Remark: Because the VM hasn't been joined domain, you need to provide the local administrator "User name" and "Password" of the VM.

13. Next to "Final state of source virtual machine" and "Final state of destination virtual machine", select "Off".


14. Click "Next".
15. On "Workspace" window, click "Browse".
16. Select a folder which you want to store a temporary virtual hard disk.


Remark: Make sure the location is enough disk space to store the double size of the source virtual hard disks.

17. Click "Next".
18. On "Hyper-V Host" window, next to "Address", type "HVSVR02".
19. Next to "Path", click "Browse".
20. Select "VM" folder, click "OK".
21. Next to "Choose the type of virtual hard disk to use for the converted disk", select "Dynamically expanding" in my test environment.


22. Click "Next".
23. On "Summary" window, click "Finish".


Then Microsoft Virtual Machine Converter will do the following steps.
  • Creating snapshot of the source virtual machine
  • Uninstalling VMware tools on source virtual machine
  • Shut down the source virtual machine
  • Download the VMware virtual disk from source virtual machine to temp location
  • Restoring the source virtual machine to original state
  • Converting VMware virtual disks and injecting drivers
  • Copying converted disks to destination VM host, HVSVR02
24. On "Completion" window, click "Close".


25. Go to "HVSVR02", log in as Domain Administrator.
26. Launch "Hyper-V Manager".



27. Right-click "Windows 2003", select "Settings".
28. Next to "Network Adapter", by default, the virtual switch hasn't applied to the VM.


29. Select a virtual switch for the VM, click "OK".
30. Connect and Power-on "Windows 2003".
31. On "Windows 2003", log in as Administrator.
32. Now, the "Hyper-V Integration Services" is installing in the VM.


Then the VM will restart automatically.

Remark: After the VM was converted, you need to reassign the IP address in the VM.

Converting a VM by Microsoft Virtual Machine Converter Plug-in for VMware vSphere Client
Prerequisites
  • Remove Windows 2003 in HVSVR02

33. Go to WS01, install "Microsoft Virtual Machine Converter Plug-in for VMware vSphere Client".
34. In vSphere Client, right-click "Windows 2003", select "Convert to Hyper-V virtual machine".


Remark: If the VMware tools is not ready, you get the following error.


35. On "Before You Begin" window, click "Next".
36. On "Connection" window, un-check "Use my Windows user account".
37. Provide the local administrator "User name" and "Password" of the VM which is installed Windows Server 2003.
38. Next to "Final state of source virtual machine" and "Final state of destination virtual machine", select "Off".


39. Click "Next".
40. On "Workspace" window, next to "Folder", type "C:\Temp".


41. Click "Next".
42. On "Hyper-V Host" window, next to "Address", type "HVSVR02".
43. Next to "Path", type "\\HVSVR02\VM".
44. Next to "Choose the type of virtual hard disk to use for the converted disk", select "Dynamically expanding".


45. Click "Next".
46. On "Summary" window, click "Finish".


As a result, the VM was converted.

Converting a VMDK to VHD
To convert a vmdk to vhd, make sure the disk is offline.

Prerequisites 
  • Copy the vmdk file to a computer which is installed "Microsoft Virtual Machine Converter Solution Accelerator"
The vmdk files were copied in C:\Temp folder of WS01.


1. On WS01, launch "Command Prompt".
2. Navigate to the installation path of "Microsoft Virtual Machine Converter Solution Accelerator".


3. Perform "MVDC.exe "C:\Temp\Windows 2003.vmdk" "C:\Temp\Windows 2003.vhd" /Dyn" to convert a VMware hard disk to a Virtual hard disk with dynamic format.


As a result, the vmdk was converted to a vhd format.


Remark: If the VMware tools of this disk hasn't uninstalled. you need to uninstall it by yourself.

Remark: The tool converted a vmdk disk to vhd disk with full size. If you select dynamic format, you may need to compact the vhd to reduce the disk size.

Reference:
Microsoft Virtual Machine Converter Administration Guide

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

Tuesday, October 23, 2012

Add an input method in Windows 8

In Windows 8, we need to use "Language" to add an input method.

1. On Windows 8, log in as user.
2. Launch "Control Panel".
3. Click "Add a language".


4. At "Change your language preferences", click "Add a language".


5. Select the language which you want to add.


6. Click "Open".
7. Select the new language, click "Options".


8. Click "Add an input method".


9. Select the input method which you want to add.


10. Click "Add".


11. Click "Save".


As a result, the input method was added.

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

Thursday, October 4, 2012

Configuring storage pool by PowerShell in Windows Server 2012

Storage pools enable you to group physical disks into one or more containers known as storage pools. You can then create virtual disks from available capacity in a storage pool without the need to manage each physical disk individually. This aggregation of disks enables you to make more efficient use of disk capacity, easily add storage without impacting users, and delegate administration of storage. You can use storage pools with Storage Spaces in Windows Server 2012 or Windows 8, or with non-Microsoft storage subsystems, including subsystems that use the SMI-S standard.

Reference:
File and Storage Services Overview

In Windows Server 2012, storage pools supports to be configured by GUI or PowerShell.

I will try to use PowerShell to configure a storage pool.

Lab environment
  • 1 Windows Server 2012 with 4 hard disks
Creating a new storage pool
1. On a server, log in as Administrator.
2. Launch "PowerShell".
3. Perform "Get-PhysicalDisk" to verify the hard disks.


The PhysicalDisk1 - 3 can be added to a storage pool because "CanPool" is true.

4. Perform "Get-StorageSubSystem".


I need to know the "FriendlyName" of "StorageSubSystem" to create a storage pool.

5. Perform "$PhysicalDisks = (Get-PhysicalDisk -FriendlyName PhysicalDisk1)".


The line uses the "Get-PhysicalDisk" cmdlet to get a PhysicalDisk object than is not yet in a (concrete) storage pool, and assigns the array of objects to the $PhysicalDisks variable. We must perform this cmdlet before creating a storage pool.

Reference:
New-StoragePool

6. Perform "New-StoragePool -FriendlyName DataPool_01 -StorageSubSystemFriendlyName "Storage Spaces on DC01" -PhysicalDisks $PhysicalDisks" to create a storage pool named "DataPool_01".


7. Perform "Get-StoragePool -FriendlyName DataPool_01 | Get-PhysicalDisk".


PhysicalDisk1 has been added into "DataPool_01".

Adding physical disks in a storage pool
8. Still in "PowerShell", perform "Get-PhysicalDisk".


The PhysicalDisk2 and 3 can be added to a storage pool because "CanPool" is true.

9. Perform "$PhysicalDisks = (Get-PhysicalDisk -CanPool $True)".


10. Perform "Add-PhysicalDisk -PhysicalDisks $PhysicalDisks -StoragePoolFriendlyName DataPool_01" to add the physical disks to "DataPool_01".


11. Perform "Get-StoragePool -FriendlyName DataPool_01 | Get-PhysicalDisk".


PhysicalDisk1 -3 were added into "DataPool_01".

Creating a new virtual disk in a storage pool
12. Still in "PowerShell", perform "New-VirtualDisk -StoragePoolFriendlyName DataPool_01 -FriendlyName DataDisk_01 -Size 2GB -ResiliencySettingName Parity -ProvisioningType Thin" to create a new virtual disk named "DataDisk_01" with "Parity" layout and "Thin" provisioning type.


Remark: To use "Parity" layout, at least 3 hard disks or more added to a storage pool. If there is not enough hard disk, it shows the following error.


Initialize a new virtual disk and create a new volume
13. Still in "PowerShell", perform "Get-Disk".


The operation status of the hard disk, Microsoft Storage Space Device which is the virtual disk, "DataDisk_01",, is offline. I need to initialize the disk.

14. Perform "Initialize-Disk -VirtualDisk (Get-VirtualDisk -FriendlyName DataDisk_01)" to initialize the virtual hard disk.


15. Perform "Get-Disk".


The operation status of the virtual hard disk is online. I need to create a volume (Partition) in the virtual disk.

16. Perform "New-Partition -DiskNumber 4 -UseMaximumSize -AssignDriveLetter" to create a new partition.


Remark: The "Disk Number " can be retrieved from the result of "Get-Disk".

17. Perform "Format-Volume -DriveLetter E" to format the volume.
18. Enter "Y".


Extend the virtual hard disk size
19. Perform "Resize-VirtualDisk -FriendlyName DataDisk_01 -Size 4GB".


20. Perform "Get-VirtualDisk".


The disk size of DataDisk_01 has been extended to 4GB.

Extend the volume size
21. Perform "Get-Partition -DriveLetter E".


The volume size of E drive is 1.97GB.

22. Perform "Get-PartitionSupportedSize -DriveLetter E" to check the volume supported size.


The virtual disk size was updated. However, the maximum supported size of this partition hasn't been updated. I need to update the maximum supported size of this partition before extend it.

23. Perform "Update-Disk -Number 4" to update the maximum supported size of the partition.


24. Perform "Get-PartitionSupportedSize -DriveLetter E" to check the volume supported size.


The maximum supported size of the partition has been updated.

25. Perform "Resize-Partition -DriveLetter E -Size 4261330432" to update the partition size to maximum.


26. Perform "Get-Partition -DriveLetter E" to verify the result.


Remove the volume in the virtual disk
27. Perform "Remove-Partition -DriveLetter E" to remove the volume.
28. Enter "Y".


29. Perform "Get-Partition -DiskNumber 4" to verify the partition in the virtual disk.


The volume, E, has been removed.

Remove the virtual disk in the storage pool
30. Perform "Get-VirtualDisk" to verify the virtual disk.


31. Perform "Remove-VirtualDisk -FriendlyName DataDisk_01" to remove the virtual disk.
32. Enter "Y".


33. Perform "Get-VirtualDisk" to verify the virtual disk.


The virtual disk has been removed.

Remark: You can remove the virtual disk without removing the volume.

Remove the storage pool
34. Perform "Get-StoragePool" to verify the storage pool.


35. Perform "Remove-StoragePool -FriendlyName DataPool_01" to remove the storage pool.
36. Enter "Y".


37. Perform "Get-StoragePool" to verify the storage pool.


The storage pool has been removed.

Remark: You have to remove the virtual disk before removing the storage pool.

For more information:
Storage Cmdlets in Windows PowerShell

Storage Spaces Overview

Storage Management Overview

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