<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to apply an ExportPolicy to a volume in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/How-to-apply-an-ExportPolicy-to-a-volume/m-p/73746#M3642</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to apply an export policy to a volume, you need to use the Update-NcVol cmdlet to update the VolumeExportAttributes policy.&amp;nbsp; Here's an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;PS C:\&amp;gt; $attr = Get-NcVol -Template&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;PS C:\&amp;gt; Initialize-NcObjectProperty -Object $attr -Name VolumeExportAttributes&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;PS C:\&amp;gt; $attr.VolumeExportAttributes.Policy = 'default'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;PS C:\&amp;gt; $query = Get-NcVol -Template&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;PS C:\&amp;gt; $query.Name = "powershell"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;PS C:\&amp;gt; $query.Vserver = "beam01"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;PS C:\&amp;gt; Update-NcVol -Query $query -Attributes $attr&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NcController : 10.63.165.62&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SuccessCount : 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;FailureCount : 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SuccessList&amp;nbsp; : {powershell}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;FailureList&amp;nbsp; : {}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using PowerShell 3 you can shorten this by using a Hashtable as the Query parameter (PowerShell will automatically create the VolumeAttributes object):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;PS C:\&amp;gt; Update-NcVol -Query @{Name="powershell";Vserver="beam01"} -Attributes $attr&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if you have any issues,&lt;/P&gt;&lt;P&gt;Steven&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Oct 2013 12:30:41 GMT</pubDate>
    <dc:creator>beam</dc:creator>
    <dc:date>2013-10-21T12:30:41Z</dc:date>
    <item>
      <title>How to apply an ExportPolicy to a volume</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/How-to-apply-an-ExportPolicy-to-a-volume/m-p/73742#M3641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We've exported the exportpolicy and the corresponding rules from an existing volume on a cluster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="php" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13820004406113931" jivemacro_uid="_13820004406113931"&gt;&lt;P&gt;$export_policy = Get-NcExportPolicy -Controller $source -Name $policy_name&lt;/P&gt;&lt;P&gt;$export_rules = Get-NcExportRule -Controller $source -Policy $export_policy&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We've created the exact policy on another cluster where this volume is vaulted to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c#" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13820007245483357" jivemacro_uid="_13820007245483357" modifiedtitle="true"&gt;&lt;P&gt;New-NcExportPolicy -Controller $destination -Name $policy_name&lt;/P&gt;&lt;P&gt;$export_rules | ForEach-Object {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $_ | New-NcExportRule -Controller $destination -Policy $policy_name -EnableSetUid&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We tried to apply this policy to a clone of this volume, but we didn't found a cmdlet which allows to apply an export policy to a volume.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get-NcVol returns the Attribut (VolumeExportAttributes.Policy) but Set-NcVol has no paramter that allows to set any additional volume options like the export policy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similar command on the &lt;STRONG&gt;cli&lt;/STRONG&gt; looks as follows:&lt;/P&gt;&lt;PRE __default_attr="c#" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13820010764954724" jivemacro_uid="_13820010764954724"&gt;&lt;P&gt;volume modify -vserver "vsname" -volume "clonename"&lt;STRONG&gt; -policy "xy"&lt;/STRONG&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to set options like the ExportPolicy?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We've noticed that there is a Set-NcNfsExport cmdlet but we don't understand how this should work in a clustered DataOntap environment, because it doesn't utilize export policies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2 style="color: #000000; font-family: 'Times New Roman';"&gt;&lt;SPAN style="font-size: 10pt;"&gt;Cmdlet: Set-NcNfsExport&lt;/SPAN&gt;&lt;/H2&gt;&lt;P&gt;SYNTAX&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set-NcNfsExport [-Path] &amp;lt;String&amp;gt; [-SecurityFlavors &amp;lt;String[]&amp;gt;] [-Anon &amp;lt;String&amp;gt;] [-ReadOnly &amp;lt;String[]&amp;gt;] [-ReadWrite &amp;lt;String[]&amp;gt;] [-Root &amp;lt;String[]&amp;gt;] [-NoSuid] [-VserverContext &amp;lt;String&amp;gt;] [-Controller &amp;lt;NcController[]&amp;gt;] [&amp;lt;CommonParameters&amp;gt;]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 09:18:22 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/How-to-apply-an-ExportPolicy-to-a-volume/m-p/73742#M3641</guid>
      <dc:creator>christio</dc:creator>
      <dc:date>2013-10-17T09:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply an ExportPolicy to a volume</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/How-to-apply-an-ExportPolicy-to-a-volume/m-p/73746#M3642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to apply an export policy to a volume, you need to use the Update-NcVol cmdlet to update the VolumeExportAttributes policy.&amp;nbsp; Here's an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;PS C:\&amp;gt; $attr = Get-NcVol -Template&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;PS C:\&amp;gt; Initialize-NcObjectProperty -Object $attr -Name VolumeExportAttributes&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;PS C:\&amp;gt; $attr.VolumeExportAttributes.Policy = 'default'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;PS C:\&amp;gt; $query = Get-NcVol -Template&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;PS C:\&amp;gt; $query.Name = "powershell"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;PS C:\&amp;gt; $query.Vserver = "beam01"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;PS C:\&amp;gt; Update-NcVol -Query $query -Attributes $attr&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NcController : 10.63.165.62&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SuccessCount : 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;FailureCount : 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SuccessList&amp;nbsp; : {powershell}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;FailureList&amp;nbsp; : {}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using PowerShell 3 you can shorten this by using a Hashtable as the Query parameter (PowerShell will automatically create the VolumeAttributes object):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;PS C:\&amp;gt; Update-NcVol -Query @{Name="powershell";Vserver="beam01"} -Attributes $attr&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if you have any issues,&lt;/P&gt;&lt;P&gt;Steven&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2013 12:30:41 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/How-to-apply-an-ExportPolicy-to-a-volume/m-p/73746#M3642</guid>
      <dc:creator>beam</dc:creator>
      <dc:date>2013-10-21T12:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply an ExportPolicy to a volume</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/How-to-apply-an-ExportPolicy-to-a-volume/m-p/105264#M4351</link>
      <description>&lt;P&gt;&lt;SPAN class="login-bold"&gt;Hello christio,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;I tried to use your code to copy the Export policy rules.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;But it looks like we have some issues, with the following code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;&lt;FONT color="#0000FF"&gt;$source = "iceage"&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;&lt;FONT color="#0000FF"&gt;$policy_name = "esxc:Nux01"&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;&lt;FONT color="#0000FF"&gt;$vserver = "inblrlabp003"&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;&lt;FONT color="#0000FF"&gt;Connect-NcController -Name $cource -Credential admin -Vserver $vserver&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;&lt;FONT color="#0000FF"&gt;$export_policy = Get-NcExportPolicy -Name $policy_name&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;&lt;FONT color="#0000FF"&gt;$export_rules = Get-NcExportRule -Policy ($export_policy).PolicyName&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;&lt;FONT color="#0000FF"&gt;New-NcExportPolicy -Name $policy_name&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;&lt;FONT color="#0000FF"&gt;$export_rules | ForEach-Object {&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;&lt;FONT color="#0000FF"&gt;$_ | New-NcExportRule -Policy $policy_name -EnableSetUid&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;&lt;FONT color="#0000FF"&gt;}&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;New-NcExportRule : The input object cannot be bound because it did not contain the information required to bind all mandatory &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;parameters: ReadOnlySecurityFlavor ReadWriteSecurityFlavor&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;At H:\Tools\ncexportpolicy.ps1:11 char:11&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;+ $_ | New-NcExportRule -Policy $policy_name -EnableSetUid&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;+ CategoryInfo : InvalidArgument: (DataONTAP.C.Types.Exports.ExportRuleInfo:PSObject) [New-NcExportRule], ParameterBinding &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;Exception&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;+ FullyQualifiedErrorId : InputObjectMissingMandatory,DataONTAP.C.PowerShell.SDK.Cmdlets.Exports.NewNcExportRule&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;Any suggestations ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;,Sheel&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2015 08:37:49 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/How-to-apply-an-ExportPolicy-to-a-volume/m-p/105264#M4351</guid>
      <dc:creator>sheelnidhig</dc:creator>
      <dc:date>2015-05-20T08:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply an ExportPolicy to a volume</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/How-to-apply-an-ExportPolicy-to-a-volume/m-p/130396#M5359</link>
      <description>&lt;P&gt;the following command can import the rules:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$export_policy = Get-NcExportPolicy -Controller $source -Name $policy_name&lt;/P&gt;&lt;P&gt;$export_rules = Get-NcExportRule -Controller $source -Policy $export_policy&lt;/P&gt;&lt;P&gt;$export_rules | ForEach-Object{ new-ncexportrule -Policy testPolicy -VserverContext SVMDes -ClientMatch $_.ClientMatch -ReadOnlySecurityFlavor any -ReadWriteSecurityFlavor any}&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2017 06:15:27 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/How-to-apply-an-ExportPolicy-to-a-volume/m-p/130396#M5359</guid>
      <dc:creator>Daniel_66</dc:creator>
      <dc:date>2017-04-24T06:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply an ExportPolicy to a volume</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/How-to-apply-an-ExportPolicy-to-a-volume/m-p/137337#M5607</link>
      <description>&lt;P&gt;A simple one liner using the name of volume and the name of the export policy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS C:\&amp;gt; update-ncvol -query @{name="&amp;lt;volume_name&amp;gt;"} -Attributes @{volumeexportattributes=@{policy="&amp;lt;export_policy_name&amp;gt;"}}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When using this type of hack, keep in mind string names are case sensitvie. &amp;nbsp;So if you have an export policy name as "ALL_UNIX_HOST", if you were to type in "all_unix_host" as the export_policy_name it would fail.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks to all who have contributed to this site.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 18:27:37 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/How-to-apply-an-ExportPolicy-to-a-volume/m-p/137337#M5607</guid>
      <dc:creator>FED_ESB</dc:creator>
      <dc:date>2018-01-16T18:27:37Z</dc:date>
    </item>
  </channel>
</rss>

