Microsoft Virtualization Discussions

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

masson
3,779 Views

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
3,751 Views

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
3,752 Views

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 "-"

masson
3,720 Views

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
3,705 Views

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

Public