<?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 Scripting SAN volume and LUN creation in ONTAP Discussions</title>
    <link>https://community.netapp.com/t5/ONTAP-Discussions/Scripting-SAN-volume-and-LUN-creation/m-p/124374#M26714</link>
    <description>&lt;P&gt;I am trying to script the creation of SAN volume and then a LUN underneath using the CLI. &amp;nbsp;The first problem is that there is no Storage Type option from the CLI that I can find. &amp;nbsp;So creating the SAN volume with one command and then creating the LUN with a second command does not seem to be an option.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second issue is if I try to just create the LUN and the volume at the same time using lun create, there is no option to select the aggregate that I want to use. &amp;nbsp;I want the script to select a particular aggregate for this process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to do this without using WFA? &amp;nbsp;Does Powershell have this capability? &amp;nbsp;I am running CDOT 8.3.2P4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jon&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jun 2025 18:35:54 GMT</pubDate>
    <dc:creator>Havox</dc:creator>
    <dc:date>2025-06-04T18:35:54Z</dc:date>
    <item>
      <title>Scripting SAN volume and LUN creation</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/Scripting-SAN-volume-and-LUN-creation/m-p/124374#M26714</link>
      <description>&lt;P&gt;I am trying to script the creation of SAN volume and then a LUN underneath using the CLI. &amp;nbsp;The first problem is that there is no Storage Type option from the CLI that I can find. &amp;nbsp;So creating the SAN volume with one command and then creating the LUN with a second command does not seem to be an option.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second issue is if I try to just create the LUN and the volume at the same time using lun create, there is no option to select the aggregate that I want to use. &amp;nbsp;I want the script to select a particular aggregate for this process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to do this without using WFA? &amp;nbsp;Does Powershell have this capability? &amp;nbsp;I am running CDOT 8.3.2P4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jon&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 18:35:54 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/Scripting-SAN-volume-and-LUN-creation/m-p/124374#M26714</guid>
      <dc:creator>Havox</dc:creator>
      <dc:date>2025-06-04T18:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting SAN volume and LUN creation</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/Scripting-SAN-volume-and-LUN-creation/m-p/124385#M26715</link>
      <description>&lt;P&gt;After doing a little testing it looks like the NFS Storage Type option in System Manager only adds a mount point. &amp;nbsp;Other than that, the volumes are exactly the same. &amp;nbsp;I guess I could run the unmount command to remove the mount to make it a "SAN" volume but that seems a bit clunky.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still working on trying to do this using the lun create command...&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2016 15:22:44 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/Scripting-SAN-volume-and-LUN-creation/m-p/124385#M26715</guid>
      <dc:creator>Havox</dc:creator>
      <dc:date>2016-10-19T15:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting SAN volume and LUN creation</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/Scripting-SAN-volume-and-LUN-creation/m-p/124405#M26717</link>
      <description>&lt;P&gt;Ok, I think I figured this out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is a two-step process with some prep up front. &amp;nbsp;My ultimate goal is to be able to provision LUNs using a third-party tool to be used as quick, temporary lab environments. &amp;nbsp;Here are the steps I went through.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Prep work&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Create a separate SVM with vsadmin enabled. &amp;nbsp;I don't want my script hitting anything but this SVM and I don't want it having system-wide admin privileges.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. The hosts on the other end will have static WWPNs so I created the igroups ahead of time in the new SVM.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. Assign the appropriate aggregates to the SVM using vserver modify command:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# vserver modify -vserver &amp;lt;svm_name&amp;gt; -aggr-list &amp;lt;comma-delimited aggregate list&amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Script - Logged in as vsadmin&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Create the volume. &amp;nbsp;Note that if you don't use the -policy option, it will not create the mount point which is the only difference from a SAN volume.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# vol create -volume &amp;lt;volume_name&amp;gt; -aggregate &amp;lt;aggregate_name&amp;gt; -size &amp;lt;GB,TB&amp;gt; -state online -type RW&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Create the LUN.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# lun create -path &amp;lt;/vol/volume_name/lun_name&amp;gt; -size &amp;lt;GB,TB&amp;gt; -ostype &amp;lt;os_name&amp;gt; -space-reserve &amp;lt;enabled,disabled&amp;gt; -space-allocation &amp;lt;enabled,disabled&amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. Map the LUN.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# lun map-path &amp;lt;/vol/volume_name/lun_name&amp;gt; -igroup &amp;lt;igroup_name&amp;gt; -lun-id &amp;lt;#&amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2016 16:24:02 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/Scripting-SAN-volume-and-LUN-creation/m-p/124405#M26717</guid>
      <dc:creator>Havox</dc:creator>
      <dc:date>2016-10-19T16:24:02Z</dc:date>
    </item>
  </channel>
</rss>

