2014-01-06 06:20 AM
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
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
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!
2014-01-06 07:14 AM
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.
2014-01-06 07:27 AM
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?
2014-01-16 12:28 PM
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?
2014-03-06 01:58 PM
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