Microsoft Virtualization Discussions

PowerShell Toolkit 4.6: Encounter errors trying to clone volumes across SVMs New-NcVolClone

booroo
4,998 Views

According to the new Syntax  "    New-NcVolClone [-CloneVolume] <String> [-ParentVolume] <String> [-SpaceReserve <String>] [-JunctionPath <String>] [-JunctionActive <Boolean>] [-VolumeType <String>]

    [-QosPolicyGroup <String>] [-CachingPolicy <String>] [-Option <String[]>] [-Comment <String>] [-Vserver <String>] [-ParentVserver <String>] [-VserverDrProtection <String>] [-Uid

    <Int64>] [-Gid <Int64>] [-VserverContext <String>] [-Controller <NcController[]>] [[-ParentSnapshot] <String>] [-ZapiRetryCount <Int32>] [<CommonParameters>]"

 

The following commmand should be working 

 

> New-NcVolClone -VserverContext devnas -ParentVolume clone_test -ParentVserver stgnas -ParentSnapshot pad -CloneVolume clone_test_version46 -JunctionPath "/clone_test_version46" -JunctionActive $true -Vserver devnas -SpaceReserve none

 

But It does not, 

 

We have encountered an error "New-NcVolClone : Extra input: junction-active; Extra input: junction-path

At line:1 char:1

+ New-NcVolClone -VserverContext devnas -ParentVolume clone_test -Paren ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo     : InvalidOperation: (dc1nas-mgmt:NcController) [New-NcVolClone], EINVALIDINPUTERROR

    + FullyQualifiedErrorId : ApiException,DataONTAP.C.PowerShell.SDK.Cmdlets.Volume.NewNcVolClone".

 

However, if we take off  two parametters "-JunctionActive $true -JunctionPath "/clone_test_version46" from the command then it works.

 

Can you guys please advise the New-NcVolClone command works with its full parametters. if so, what will be the correct order to get everything in line.

 

Cheers,

1 ACCEPTED SOLUTION

asulliva
4,873 Views

I believe this is a result of a documentation "bug".

 

There are two different versions of the API which the New-NcVolClone cmdlet consumes, one at the cluster level and one at the SVM level.  The SVM level API uses the two parameters you're specifying (JunctionActive and JunctionPath), however the cluster level API does not.  When doing a cross-SVM volume clone the cluster level API must be used.

 

Here is how I believe the parameter sets for the two versions of the API should work...

 

# intra-SVM volume clone
New-NcVolClone 
    [-CloneVolume] <String> 
    [-ParentVolume] <String> 
    [[-ParentSnapshot] <String>] 
    [-SpaceReserve <String>] 
    [-JunctionPath <String>] 
    [-JunctionActive [<Boolean>]] 
    [-VolumeType <String>] 
    [-QosPolicyGroup <String>] 
    [-Comment <String>] 
    [-VserverDrProtection  <String>] 
    [-Uid <Int64>] 
    [-Gid <Int64>] 
    [-VserverContext <String>] 
    [-Controller <NcController[]>] 
    [-ZapiRetryCount <Int32>] 
    [<CommonParameters>]

# cross-SVM volume clone
New-NcVolClone 
    [-SpaceReserve <String>] 
    [-VolumeType <String>] 
    [-QosPolicyGroup <String>] 
    [-Vserver <String>] 
    [-CloneVolume] <String> 
    [-ParentVserver <String>] 
    [-ParentVolume] <String> 
    [[-ParentSnapshot] <String>] 
    [-Controller <NcController[]>] 
    [-ZapiRetryCount <Int32>] 
    [<CommonParameters>]

The documentation for the New-NcVolClone cmdlet also includes two parameters, CachingPolicy and Option, which have no equivelant in the ONTAP 9.3 ZAPI docs.  This could mean a few things, the most likely is that those options existed in earlier versions of ZAPI and are still there for legacy reasons, but could also be some "magic" happening in the cmdlet to apply additional options to the volume after it's cloned for convenience.  It could also simply be a(nother) documentation bug.

 

I'm going to create a bug for this issue.  If you are willing to PM me your mailing address, I'm happy to send you some stickers as a "bug bounty" : )

 

Hope that helps.

 

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

View solution in original post

5 REPLIES 5

asulliva
4,944 Views

Simplest solution would be to just leave off the two parameters, then junction the volume using the Mount-NcVol cmdlet.

 

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

booroo
4,888 Views

I was thinking of that, but the point is why I was just following the New-NcVolClone syntax but it does not work? If so, NetApp should fix it 

asulliva
4,874 Views

I believe this is a result of a documentation "bug".

 

There are two different versions of the API which the New-NcVolClone cmdlet consumes, one at the cluster level and one at the SVM level.  The SVM level API uses the two parameters you're specifying (JunctionActive and JunctionPath), however the cluster level API does not.  When doing a cross-SVM volume clone the cluster level API must be used.

 

Here is how I believe the parameter sets for the two versions of the API should work...

 

# intra-SVM volume clone
New-NcVolClone 
    [-CloneVolume] <String> 
    [-ParentVolume] <String> 
    [[-ParentSnapshot] <String>] 
    [-SpaceReserve <String>] 
    [-JunctionPath <String>] 
    [-JunctionActive [<Boolean>]] 
    [-VolumeType <String>] 
    [-QosPolicyGroup <String>] 
    [-Comment <String>] 
    [-VserverDrProtection  <String>] 
    [-Uid <Int64>] 
    [-Gid <Int64>] 
    [-VserverContext <String>] 
    [-Controller <NcController[]>] 
    [-ZapiRetryCount <Int32>] 
    [<CommonParameters>]

# cross-SVM volume clone
New-NcVolClone 
    [-SpaceReserve <String>] 
    [-VolumeType <String>] 
    [-QosPolicyGroup <String>] 
    [-Vserver <String>] 
    [-CloneVolume] <String> 
    [-ParentVserver <String>] 
    [-ParentVolume] <String> 
    [[-ParentSnapshot] <String>] 
    [-Controller <NcController[]>] 
    [-ZapiRetryCount <Int32>] 
    [<CommonParameters>]

The documentation for the New-NcVolClone cmdlet also includes two parameters, CachingPolicy and Option, which have no equivelant in the ONTAP 9.3 ZAPI docs.  This could mean a few things, the most likely is that those options existed in earlier versions of ZAPI and are still there for legacy reasons, but could also be some "magic" happening in the cmdlet to apply additional options to the volume after it's cloned for convenience.  It could also simply be a(nother) documentation bug.

 

I'm going to create a bug for this issue.  If you are willing to PM me your mailing address, I'm happy to send you some stickers as a "bug bounty" : )

 

Hope that helps.

 

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

OzStuV2
2,919 Views

Gah, ran into this exact problem today, means I need an extra step to mount the vol  and specify the junction path. 

<grumble grumble>

 

Thanks for posting the explanation!

asulliva
4,870 Views

FYI, bug id is 1165240.

 

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.
Public