Microsoft Virtualization Discussions

Want to set volume parameters using PowerShell: convert_ucode, create_ucode

DLIVINGSTONNETAPP
7,805 Views

Background:
This is my first attempt at PowerShell.  I am a UNIX sys admin accustomed to doing some shell scripting.
I'm completely new to anything object-oriented.

Problem:

I want to enable unicode support on all volumes except vol0, by setting convert_ucode and create_ucode to "on".
I have a variable $vols defined, as a listing of volume names on controller netapp1, excluding vol0:

PS C:\Windows\system32> $vols=get-navol |where {$_.Name -ne "vol0"} |select Name

PS C:\Windows\system32> $vols

Name
----
BCM_oracle_BCM_102_64
BCM_oracle_client_10x_64
BCM_oracle_stage
BCM_sapmnt_BCM_global
BCM_sapmnt_BCM_profile
.
.
.


My latest attempt to set the desired params is the following foreach loop, which produces
the errors shown following it:

PS C:\Windows\system32> foreach ($vol in $vols) {
>> set-navoloption $vol create_ucode on
>> set-navoloption $vol convert_ucode on
>> }
>>
Set-NaVolOption : No volume named '@{Name=BCM_oracle_BCM_102_64}' exists
At line:2 char:16
+ set-navoloption <<<<  $vol create_ucode on
    + CategoryInfo          : InvalidOperation: (netapp1:NaController) [Set-NaVolOption], EONTAPI_ENOENT
    + FullyQualifiedErrorId : ApiException,DataONTAP.PowerShell.SDK.Cmdlets.Volume.SetNaVolOption

Set-NaVolOption : No volume named '@{Name=BCM_oracle_BCM_102_64}' exists
At line:3 char:16
+ set-navoloption <<<<  $vol convert_ucode on
    + CategoryInfo          : InvalidOperation: (netapp1:NaController) [Set-NaVolOption], EONTAPI_ENOENT
    + FullyQualifiedErrorId : ApiException,DataONTAP.PowerShell.SDK.Cmdlets.Volume.SetNaVolOption

Set-NaVolOption : No volume named '@{Name=BCM_oracle_client_10x_64}' exists
At line:2 char:16
+ set-navoloption <<<<  $vol create_ucode on
    + CategoryInfo          : InvalidOperation: (netapp1:NaController) [Set-NaVolOption], EONTAPI_ENOENT
    + FullyQualifiedErrorId : ApiException,DataONTAP.PowerShell.SDK.Cmdlets.Volume.SetNaVolOption
.
.
.

I can assure the server that the volumes exist.  What am I missing?

Thanks,
David

1 ACCEPTED SOLUTION

FranciscoHH
7,805 Views

Hi David.

You must use:

set-navoloption $vol.Name

$vol is an powershell object. You need only the property volume name.

You can see properties an methods for a powershell object with:

$vol | Get-Member

View solution in original post

8 REPLIES 8

FranciscoHH
7,806 Views

Hi David.

You must use:

set-navoloption $vol.Name

$vol is an powershell object. You need only the property volume name.

You can see properties an methods for a powershell object with:

$vol | Get-Member

DLIVINGSTONNETAPP
7,805 Views

Thank you, Francisco, that works!  This piece of learning will also help me get future tasks done.

David

sgh
7,201 Views

HI,

 

vol options " convert_ucode, create_ucode - on/off " Can u give me some clear picture about it.

-  in iscsi-lun- what is the use of this options?

- in NFS and CIFS- what is the use of this options?

 

Appriciate your time and notes.

 

 

asulliva
7,199 Views

From the man pages:

 

convert_ucode on | off

Setting this option to on forces conversion of all directories to UNICODE format when accessed from both NFS and CIFS. By default, it is set to off, in which case access from CIFS causes conversion of pre-4.0 and 4.0 format directories. Access from NFS causes conversion of 4.0 format directories. The default setting is off.

 

create_ucode on | off

Setting this option to on forces UNICODE format directories to be created by default, both from NFS and CIFS. By default, it is set to off, in which case all directories are created in pre-4.0 format, and the first CIFS access will convert it to UNICODE format. The default setting is off.

 

For LUNs these settings have no effect.

 

Andrew

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

sgh
7,195 Views

Thank you dear for quick response.

 

Also I know this info and I would like to what is the exact use of this. Can you make bit clear as a pratical.

 

Thanks a lot.

asulliva
7,179 Views

If you will be creating files named using a character set which requires unicode (e.g. foreign languages), then enable the settings.  If not, then you should be fine without.  I typically turn them on for all of my CIFS share and NFS export volumes by default.

 

Andrew

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

aborzenkov
7,162 Views

If not [creating files], then you should be fine without.

Then why NetApp makes it mandatory to turn ucode on when LUN is created on volumes?

sgh
7,141 Views

Thanks a lot!

Public