I believe in Hyper-V!

Hyper-VCategory Archives

About Hyper-V technology

Remove an iSCSI Target on Windows Server 2012 R2

In this blog post I’d like to explain how to remove old, unusable, inactive iSCSI Targets on Windows Server 2012 R2.
In one of my labs environment I created few iSCSI Targets and I don’t need them any more. So, I want to remove them.

NOTE:When you remove a target, all initiators currently logged on to that target will no longer be able to access the LUNs that are assigned to that target. This action cannot be undone.”

Under Server Manager console expand File and Storage Services – iSCSI. At the bottom you will see iSCSI Targets tab. Click on TASKS (on the right hand side), you will see tab View all Targets.

1

All iSCSI, active and inactive will appear. As you can see in the picture below, I have only one active iSCSI Target and want to delete all inactive iSCSI Targets.

2

Only what need to do is to click on the iSCSI Target and then click Remove Target.

3
6

Now we have only a few iSCSI Targets to remove…
Unfortunately we can’t select all inactive iSCSI Targets and remove them in one click, we need to remove one by one.

At the end we have only active iSCSI Target as we should to have.

7

Enjoy the day and have a nice weekend!

Romeo

Hyper-V did not find virtual machines to import from location “*”… migration from 2K8R2 to WS2012R2

As I said a few times so far, I have been writing blog posts to be my reminder and help to other blog readers :). Two days ago I migrate one of virtual machines from Windows Server 2008 R2 Hyper-V host to Windows Server 2012 R2 Hyper-V host. As many times until now I did Export then copy to the new storage and then Import, but… I forgot that I already did that a few months ago and what first need to do :). I got error like in the picture below ;)

1

This isn’t something new. I rewrite Rhoderick’s and Taylor’s articles. Thank you guys.

VM’s that are exported from Windows Server 2008 or 2008 R2 utilized the version 1 WMI namespace which resulted in a .exp file to represent the exported virtual machine. In Windows Server 2012 we introduced a new WMI namespace (version 2 or root\virtualization\v2) which implemented a much better import/export model – allowing you to effectively just copy the virtual machine folder (with the VM’s XML configuration file inside it) as well as the VM’s VHDs and then import that directly. For Windows Server 2012 we maintained the version 1 WMI namespace which allowed for importing of Windows Server 2008/R2 VM’s on 2012.

In Windows Server 2012 R2 we have removed the old version 1 namespace which means we can’t import virtual machines that where exported from Windows Server 2008/R2. However we can import them if you copy the virtual machine xml file and VHD’s – to do this you need to stop the vmms on the 2008/R2 server – copy all of the virtual machine files/vhds to the Windows Server 2012 R2 server and then import them.

What to do? We have two solutions!

The first is as follows:

Shut down all Hyper-V virtual machines on the WS2008R2 host then stop the Hyper-V Virtual Machine Management service.

1

net stop "Hyper-V Virtual Machine Management"

1

Copy all virtual machines what you want to migrate to WS2012R2 Hyper-V host then Import Virtual Machine… That’s easy way, but…

1

What if we already did Export and we don’t have WS2008R2 Hyper-V host?

The second resolution is as follows:

Exported Hyper-V virtual machines copy on the Windows Server 2012 and import them, then simple copy to a Windows Server 2012 R2. That server is only used to perform the import thus allowing the VM to be copied to Windows Server 2012 R2.

Now we can do whatever we want to do :)

I worked over the holidays and from tomorrow I’m going to deserved break until the end of the week.

Enjoy the day!

Romeo

Virtual disks under Storage Spaces won’t stay attached after reboot!

Few days ago friend of mine asked me if I know how to fix this issue and I succeeded. Now I want to share with all of you.
The scenario is as follows…

Windows Server 2012 R2, one Storage Pool, few virtual disks. The behavior starts to happen after Windows Server 2012 R2 re-installation. Everything was fine until restart. Virtual Disks are present and attached but after restart the server they are detached.

Before restart.10

After restart
10

If you are looking under virtual disk Properties/Details/Property (look picture below) you will notice that IsManualAttach – Value is True. In other words, if you want virtual disk be attached you must do manually attach.

10

Resolution

Open PowerShell as administrator, type as follows and press Enter

Set-virtualdisk -FriendlyName <VirtualDiskName> -IsManualAttach $false

10

Refresh Server Manager Console and you Virtual Disks will be attached. After you restart your server Virtual Disks still be attached ;)

10
10

I wish you all the best in 2014!

Enjoy the day :)

Cheers!

Romeo