Microsoft Virtualization Discussions

Repair-NaVirtualDiskAlignment Issue

RICH_SHIRLEY
4,149 Views

Hi Guys,

When running the Repair-NaVirtualDiskAlignment command to try and realign one of our Server 2003 R2 VM's (using Hyper-V) I'm getting the following error message:

PS C:\> Repair-NaVirtualDiskAlignment \\gbprhv32\c$\ClusterStorage\Volume2\GBVUTS97\GBVUTS97_C.vhd -controller GBPRNA01

Repair-NaVirtualDiskAlignment : Cannot bind parameter 'Controller'. Cannot convert value "GBPRNA01" to type "NetApp.Ont

api.AbstractController". Error: "Cannot create an instance of NetApp.Ontapi.AbstractController because it is an abstrac

t class."

At line:1 char:103

+ Repair-NaVirtualDiskAlignment \\gbprhv32\c$\ClusterStorage\Volume2\GBVUTS97\GBVUTS97_C.vhd -controller <<<<  GBPRNA01

    + CategoryInfo          : InvalidArgument: (:) [Repair-NaVirtualDiskAlignment], ParameterBindingException

    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,DataONTAP.PowerShell.SDK.Cmdlets.HyperV.RepairNaVirtualDi

   skAlignment

Any suggestions as to how I can resolve this? As I've got 20+ VM's I need to realign, and really don't fancy having to do them all one by one using either xcopy or Ghost!

Cheers,

Rich

5 REPLIES 5

beam
4,149 Views

Hi Rich,

The Controller parameter is a controller object obtained by either Connect-NaController or Connect-NcController.  If you've already established a connection using Connect-NaController, and the global $CurrentNaController variable is set, you do not need to specify the Controller parameter.

Here's an example explicitly specifying the Controller parameter:

$c = Connect-NaController 10.61.167.86

Repair-NaVirtualDiskAlignment C:\ClusterStorage\Volume2\VirtualDisks\testVM1.vhd -Controller $c

The first command establishes the connection to the controller and stores the result in the variable $c.  The second command runs the alignment with the Controller parameter set to the variable $c.

Thanks,

Steven

RICH_SHIRLEY
4,149 Views

Hi Steve,

I'm afraid we I exactly the same error  when I try the commands in that order. Do you think there could be  something specific to our environment that would cause this to fail?

Cheers,

Rich

beam
4,149 Views

Hi Rich,

What version of the Toolkit are you running?  You can use Get-NaToolkitVersion to find out.

I don't understand why you would be seeing the same error when providing the controller object explicitly.  The error in your original post is PowerShell failing to coerce the string into an abstract type; by providing an object of that type you should at the very least get past that parameter validation.

Have you tried using Connect-NaController to make the connection and leaving the -Controller parameter out of Repair-NaVirtualDiskAlignment entirely?

Thanks,

Steven

RICH_SHIRLEY
4,149 Views

Any suggestions?

Cheers,

Rich

jeromerichard
4,149 Views

Hi,

the last time i used it, i needed to precise the vserver name to use this command :

$vserver=Connect-NcController myNetappcluster -Credential admin -Vserver myVserver

Repair-NcVirtualDiskAlignment -VirtualDisk C:\ClusterStorage\VolumeX\MyVM\fixed_c.vhd -Controller $vserver

Public