The transition to NetApp MS Azure AD B2C is complete. If you missed the pre-registration, you will be invited to reigister at next log in.
Please note that access to your NetApp data may take up to 1 hour.
To learn more, read the FAQ and watch the video.
Need assistance? Complete this form and select “Registration Issue” as the Feedback Category.

Microsoft Virtualization Discussions

Failed to set an empty SnapmirrorLabel with Set-NcSnapshotPolicySchedule with PSTK 4.3

masson

Hello,

 

I'm trying to delete a snapmirrorlabel from a snapshot policy schedule with

Set-NcSnapmirrorPolicySchedule

but contrary to help which indicate that an empty label will delete the existing label, it is impossible to delete a label and return an empty label ("-" from cli)

 

New-NcSnapshotPolicy -Name TCO -Schedule hourly -Count 48 -Prefix hourly

Policy               Enabled SnapshotPolicySchedules                                                                                                        
------               ------- -----------------------                                                                                                        
TCO                   True   {hourly (48)}

give me the result:

cot-3-demofr::*> snapshot policy show -policy TCO
Vserver: cot-3-demofr
                         Number of Is
Policy Name              Schedules Enabled Comment
------------------------ --------- ------- ----------------------------------
TCO                              1 true    -
    Schedule               Count     Prefix                 SnapMirror Label
    ---------------------- -----     ---------------------- -------------------
    hourly                    48     hourly                 -

I then set a snapmirrorlabel with

 

Set-NcSnapshotPolicySchedule -name TCO -Schedule hourly -Count 48 -SnapmirrorLabel test

Policy               Enabled SnapshotPolicySchedules                                                                                                        
------               ------- -----------------------                                                                                                        
TCO                   True   {hourly (48)}

which give me the correct label:

cot-3-demofr::*> snapshot policy show -policy TCO
Vserver: cot-3-demofr
                         Number of Is
Policy Name              Schedules Enabled Comment
------------------------ --------- ------- ----------------------------------
TCO                              1 true    -
    Schedule               Count     Prefix                 SnapMirror Label
    ---------------------- -----     ---------------------- -------------------
    hourly                    48     hourly                 test

But after i'm not able to return to an empty snapmirrorlabel, whatever command i used:

 

Set-NcSnapshotPolicySchedule -name TCO -Schedule hourly -Count 48 -SnapmirrorLabel "-"
Set-NcSnapshotPolicySchedule : The SnapMirror Label name "-" is invalid. SnapMirror Label name must contain at least one character and must not contain 
leading or trailing white space. 
At line:1 char:1
+ Set-NcSnapshotPolicySchedule -name TCO -Schedule hourly -Count 48 -Sn ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (cOT3-demofr:NcController) [Set-NcSnapshotPolicySchedule], EINVALIDINPUTERROR
    + FullyQualifiedErrorId : ApiException,DataONTAP.C.PowerShell.SDK.Cmdlets.Snapshot.SetNcSnapshotPolicySchedule
Set-NcSnapshotPolicySchedule -name TCO -Schedule hourly -Count 48 -SnapmirrorLabel ""

Policy               Enabled SnapshotPolicySchedules                                                                                                        
------               ------- -----------------------                                                                                                        
TCO                   True   {hourly (48)} 


cot-3-demofr::*> snapshot policy show -policy TCO
Vserver: cot-3-demofr
                         Number of Is
Policy Name              Schedules Enabled Comment
------------------------ --------- ------- ----------------------------------
TCO                              1 true    -
    Schedule               Count     Prefix                 SnapMirror Label
    ---------------------- -----     ---------------------- -------------------
    hourly                    48     hourly                 test

Set-NcSnapshotPolicySchedule -name TCO -Schedule hourly -Count 48

Policy               Enabled SnapshotPolicySchedules                                                                                                        
------               ------- -----------------------                                                                                                        
TCO                   True   {hourly (48)}                                                                                                                  



cot-3-demofr::*> snapshot policy show -policy TCO
Vserver: cot-3-demofr
                         Number of Is
Policy Name              Schedules Enabled Comment
------------------------ --------- ------- ----------------------------------
TCO                              1 true    -
    Schedule               Count     Prefix                 SnapMirror Label
    ---------------------- -----     ---------------------- -------------------
    hourly                    48     hourly                 test

Is this a bug?

Do i'm doing something wrong?

I know i can delete the policy to recreate it without any snapmirrorlabel, but it's not my need.

 

TIA

 

Regards

1 ACCEPTED SOLUTION

JGPSHNTAP

Funny, I went to my lab and tried that as well.

 

I used a `n and that blanked it out, but I can't figure out why I can't use "-"

View solution in original post

3 REPLIES 3

JGPSHNTAP

Funny, I went to my lab and tried that as well.

 

I used a `n and that blanked it out, but I can't figure out why I can't use "-"

View solution in original post

masson

Hi 

 

Thanks for the tips

It not exactly the same result as snapmirror label "-"

Because in that case the snapmirror label is not empty, but it contains "`n"

But in the same time does a snapmirror label with "-" is an "empty" snapmirror label?

 

TIA

 

Regards

 

JGPSHNTAP

Well, what's interesting is I just fed in `n = new line in powershell.  I tried what you did with - but it told me - isn't valid.  Then I asked myself why did it show me that - with the policy with no label.

 

I also tried $null, no dice.

 

I think it's a bug and should be fixed  "" should work

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public