Subscribe

Run Repair-NaVirtualDiskAlignment without interaction

How do you run Repair-NaVirtualDiskAlignment so that it does not prompt to continue

We are currently running DataOnTap 8 so the command falls back to host-based copy, which is fine.

When executing: Repair-NaVirtualDiskAlignment  -virtualdisk $VHDFullPath -controller $controller

Aligning virtual disk
Are you sure you wish to align partitions on virtual disk C:\ClusterStorage\Volume1\skeet\189ba1eb-643b-11df-808f-806e6f6e6963_2011-04-05T162446.vhd?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [?] Help (default is "Y"): y

Using host-based copy
A host-based copy will be used.  This may take several minutes.  Are you sure you wish to continue?
[Y] Yes  [N] No  [?] Help (default is "Y"):

When executing: Repair-NaVirtualDiskAlignment -virtualdisk $VHDFullPath -controller $controller -confirm:$False

Using host-based copy

A host-based copy will be used.  This may take several minutes.  Are you sure you wish to continue?

[Y] Yes  [N] No  [?] Help (default is "Y"):

Is there a way to answer the host-based copy question, so no user interaction is required?

Re: Run Repair-NaVirtualDiskAlignment without interaction

Hey Scott,

Your running into what's known as a shouldcontinue prompt.  ShouldContinue is a means for the developer to ensure you see they're warning before they continue in the code path.  In this case were warning that your running a version of DOT that doesn't currently support copy offload and  we'll have to copy the data through the host.  So far so good, the PowerShell coding guidlines dictate that whenever shouldcontinue is used there must be a switch to override.   In our case that switch is -ForceHostCopy.. .

Try:

  Repair-NaVirtualDiskAlignment -VirtualDisk C:\ClusterStorage\Volume1\skeet\189ba1eb-643b-11df-808f-806e6f6e6963_2011-04-05T162446.vhd -Confirm:$false -ForceHostCopy

Re: Run Repair-NaVirtualDiskAlignment without interaction

Using -ForceHost copy with -Confirm:$false still results in

Using host-based copy

A host-based copy will be used.  This may take several minutes.  Are you sure you wish to continue?

[Y] Yes  [N] No  [?] Help (default is "Y"):

Which is why i am looking for more information on why -Confirm:$false even when -ForceHostCopy is used only seems to apply to the "Are you sure you wish to align partitions on virtual disk" question.

Thanks for your prompt assistance with this issue!

Re: Run Repair-NaVirtualDiskAlignment without interaction

Hi, Scott.  Agreed, you should not see the secondary ShouldContinue prompt if you specify -ForceHostCopy.  We'll aim to address that in the next release.

Re: Run Repair-NaVirtualDiskAlignment without interaction

Do you know when that might happen?

Re: Run Repair-NaVirtualDiskAlignment without interaction

Yesterday.