Effective December 3, NetApp adopts Microsoft’s Business-to-Customer (B2C) identity management to simplify and provide secure access to NetApp resources.
For accounts that did not pre-register (prior to Dec 3), access to your NetApp data may take up to 1 hour as your legacy NSS ID is synchronized to the new B2C identity.
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

Get-NcVolOption and Set-NcVolOption for vol Comment

scheckel

Hi,

my customer wants to use powershell toolkit to set a volume comment.

On CLI:

wdflab1::> vol show -vserver wdflabvs01 -volume clone_test -fields comment

  (volume show)

vserver    volume     comment

---------- ---------- -------

wdflabvs01 clone_test test

On powershell:

PS C:\Users\scheckel> Get-NcVolOption -name clone_test -VserverContext wdflabvs01

Name                                    NcController                            Value

----                                    ------------                            -----

actual_guarantee                        10.68.94.111                            none

convert_ucode                           10.68.94.111                            on

create_ucode                            10.68.94.111                            on

effective_guarantee                     10.68.94.111                            none

extent                                  10.68.94.111                            off

fractional_reserve                      10.68.94.111                            0

fs_size_fixed                           10.68.94.111                            off

guarantee                               10.68.94.111                            none

ignore_inconsistent                     10.68.94.111                            off

max_write_alloc_blocks                  10.68.94.111                            0

maxdirsize                              10.68.94.111                            190054

minra                                   10.68.94.111                            off

no_atime_update                         10.68.94.111                            off

no_i2p                                  10.68.94.111                            off

nosnap                                  10.68.94.111                            on

nosnapdir                               10.68.94.111                            off

nvfail                                  10.68.94.111                            off

read_realloc                            10.68.94.111                            off

root                                    10.68.94.111                            false

schedsnapname                           10.68.94.111                            create_time

snapmirrored                            10.68.94.111                            off

snapshot_clone_dependency               10.68.94.111                            off

try_first                               10.68.94.111                            volume_grow

The same for set,

How i can realize this?

Best wishes,

Markus.

1 ACCEPTED SOLUTION

cole

You can use the Update-NcVol cmdlet for this.  The example for that cmdlet describes this exact scenario (updating the comment field).  Or, as Vinith mentions, Invoke-NcSsh works just as well.

--------------  Example 1 --------------

C:\PS>$q = Get-NcVol -Template

Initialize-NcObjectProperty $q VolumeIdAttributes

$q.VolumeIdAttributes.Name = "vol1|vol2"

$q.VolumeIdAttributes.OwningVserverName = "vserver1"

$a = Get-NcVol -Template

Initialize-NcObjectProperty $a VolumeIdAttributes

$a.VolumeIdAttributes.Comment = "Database volumes"

Update-NcVol -Query $q -Attributes $a

Using this cmdlet and others, execute an advanced query to set the comment field on multiple volumes.

NcController : 10.61.172.155

SuccessCount : 2

FailureCount : 0

SuccessList  : {vol1, vol2}

FailureList  : {}

View solution in original post

2 REPLIES 2

cole

You can use the Update-NcVol cmdlet for this.  The example for that cmdlet describes this exact scenario (updating the comment field).  Or, as Vinith mentions, Invoke-NcSsh works just as well.

--------------  Example 1 --------------

C:\PS>$q = Get-NcVol -Template

Initialize-NcObjectProperty $q VolumeIdAttributes

$q.VolumeIdAttributes.Name = "vol1|vol2"

$q.VolumeIdAttributes.OwningVserverName = "vserver1"

$a = Get-NcVol -Template

Initialize-NcObjectProperty $a VolumeIdAttributes

$a.VolumeIdAttributes.Comment = "Database volumes"

Update-NcVol -Query $q -Attributes $a

Using this cmdlet and others, execute an advanced query to set the comment field on multiple volumes.

NcController : 10.61.172.155

SuccessCount : 2

FailureCount : 0

SuccessList  : {vol1, vol2}

FailureList  : {}

View solution in original post

vinith

Can you try using

Invoke-NcSsh

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