<?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: cli to create new virtual disks in vSphere Command-Line Interface Discussions</title>
    <link>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/cli-to-create-new-virtual-disks/m-p/2651705#M1331</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, I guess the heat has pretty much gone out of this one but I &lt;EM&gt;did&lt;/EM&gt; get the VI web client to successfully "see" a disk created with vmkfstools.&amp;nbsp; It appears while that utility certainly &lt;EM&gt;creates&lt;/EM&gt; the disk, it doesn't actually &lt;EM&gt;assign&lt;/EM&gt; it to a VM (even though it seems to be embedded in the disk path spec):&amp;nbsp; until that happens, neither the VI client nor the earmarked VM can see it.&amp;nbsp; The trick was to use DCLI:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;dcli com vmware vcenter vm hardware disk create --vm vm-&lt;/STRONG&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;EM&gt;idx&lt;/EM&gt;&lt;/SPAN&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt; --backing-type VMDK_FILE --backing-vmdk-file "[&lt;/STRONG&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;EM&gt;datastore&lt;/EM&gt;&lt;/SPAN&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;] &lt;/STRONG&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;EM&gt;path&lt;/EM&gt;&lt;/SPAN&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;/&lt;/STRONG&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;EM&gt;name&lt;/EM&gt;&lt;/SPAN&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;.vmdk"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where &lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;EM&gt;idx&lt;/EM&gt;&lt;/SPAN&gt; is the "index" assigned to the VM, this can be obtained with another DCLI command:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'Courier New';"&gt;dcli com vmware vcenter vm list&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;and the vmdk file path is the one previously created by vmkfstools.&amp;nbsp; When run successfully, this returns the disks integer ID and you should see it now reported against the VM's hardware with the &lt;STRONG&gt;Hard disk&lt;/STRONG&gt; &lt;EM&gt;n&lt;/EM&gt; label and the (I'm assuming Linux) VM will see it through the device file path &lt;STRONG&gt;/dev/sd&lt;/STRONG&gt;&lt;EM&gt;x&lt;/EM&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;At least, that's how it's worked for me (vSphere/vCLI 6.5.0).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Jun 2017 04:52:07 GMT</pubDate>
    <dc:creator>HDBR</dc:creator>
    <dc:date>2017-06-30T04:52:07Z</dc:date>
    <item>
      <title>cli to create new virtual disks</title>
      <link>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/cli-to-create-new-virtual-disks/m-p/2651700#M1326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can use '&lt;CODE&gt;vmkfstools --createvirtualdisk &amp;lt;size&amp;gt;G --diskformat thin &amp;lt;location&amp;gt;&lt;/CODE&gt;' to create a new virtual disk (*.vmdk) file, but how do I get the VM to recognize&amp;nbsp;this new disk in its configuration?&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;I need to do this through the cli. I can do it in vSphere Client in Edit Settings, Add, Hard Disk, "Use an existing virtual disk".&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;Anyone successfully&amp;nbsp;do this using esxcli or other CLI commands, or in&amp;nbsp;the Perl SDK?&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;&amp;nbsp;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Oct 2015 14:53:47 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/cli-to-create-new-virtual-disks/m-p/2651700#M1326</guid>
      <dc:creator>fsckit</dc:creator>
      <dc:date>2015-10-22T14:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: cli to create new virtual disks</title>
      <link>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/cli-to-create-new-virtual-disks/m-p/2651701#M1327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&amp;amp;cmd=displayKC&amp;amp;externalId=1006685" title="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&amp;amp;cmd=displayKC&amp;amp;externalId=1006685"&gt;VMware KB: Hot adding a virtual disk to a virtual machine from command line interface&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the KB with information that you need.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Oct 2015 15:49:20 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/cli-to-create-new-virtual-disks/m-p/2651701#M1327</guid>
      <dc:creator>npadmani</dc:creator>
      <dc:date>2015-10-22T15:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: cli to create new virtual disks</title>
      <link>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/cli-to-create-new-virtual-disks/m-p/2651702#M1328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you. Yes, I saw that KB and I was able to get "vim-cmd vmsvc/device.diskaddexisting" to work. However, if possible I'd rather do this with remote CLI commands. If I can avoid it, I don't want to have to activate ssh on the ESXi host and log in to run vim-cmd commands.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm running vmkfstools from a vMA.&amp;nbsp; Know of any remote CLI command that hot-adds virtual disks?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Oct 2015 18:31:14 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/cli-to-create-new-virtual-disks/m-p/2651702#M1328</guid>
      <dc:creator>fsckit</dc:creator>
      <dc:date>2015-10-22T18:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: cli to create new virtual disks</title>
      <link>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/cli-to-create-new-virtual-disks/m-p/2651703#M1329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you have only PowerCLI left with you to do this.&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.vmware.com/support/developer/PowerCLI/PowerCLI41/html/New-HardDisk.html" title="https://www.vmware.com/support/developer/PowerCLI/PowerCLI41/html/New-HardDisk.html"&gt;New-HardDisk - vSphere PowerCLI Cmdlets Reference&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Oct 2015 02:17:07 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/cli-to-create-new-virtual-disks/m-p/2651703#M1329</guid>
      <dc:creator>npadmani</dc:creator>
      <dc:date>2015-10-23T02:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: cli to create new virtual disks</title>
      <link>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/cli-to-create-new-virtual-disks/m-p/2651704#M1330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually the vSphere SDK for Perl should be able to do this. In fact, one of the included William Lam scripts, vmdkManagement.pl, does exactly this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vmdkManagement.pl --server &amp;lt;vCenter&amp;gt; --username &amp;lt;me&amp;gt; --operation add --vmdkname &amp;lt;filename.vmdk&amp;gt; --vmname &amp;lt;VM&amp;gt; --datastore &amp;lt;datastore&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem is, it always adds the disk to controller 0. When I edit the Perl script to use controller 1 (or any other controller), it fails. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2015 13:29:15 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/cli-to-create-new-virtual-disks/m-p/2651704#M1330</guid>
      <dc:creator>fsckit</dc:creator>
      <dc:date>2015-12-03T13:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: cli to create new virtual disks</title>
      <link>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/cli-to-create-new-virtual-disks/m-p/2651705#M1331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, I guess the heat has pretty much gone out of this one but I &lt;EM&gt;did&lt;/EM&gt; get the VI web client to successfully "see" a disk created with vmkfstools.&amp;nbsp; It appears while that utility certainly &lt;EM&gt;creates&lt;/EM&gt; the disk, it doesn't actually &lt;EM&gt;assign&lt;/EM&gt; it to a VM (even though it seems to be embedded in the disk path spec):&amp;nbsp; until that happens, neither the VI client nor the earmarked VM can see it.&amp;nbsp; The trick was to use DCLI:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;dcli com vmware vcenter vm hardware disk create --vm vm-&lt;/STRONG&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;EM&gt;idx&lt;/EM&gt;&lt;/SPAN&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt; --backing-type VMDK_FILE --backing-vmdk-file "[&lt;/STRONG&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;EM&gt;datastore&lt;/EM&gt;&lt;/SPAN&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;] &lt;/STRONG&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;EM&gt;path&lt;/EM&gt;&lt;/SPAN&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;/&lt;/STRONG&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;EM&gt;name&lt;/EM&gt;&lt;/SPAN&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;.vmdk"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where &lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;EM&gt;idx&lt;/EM&gt;&lt;/SPAN&gt; is the "index" assigned to the VM, this can be obtained with another DCLI command:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'Courier New';"&gt;dcli com vmware vcenter vm list&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;and the vmdk file path is the one previously created by vmkfstools.&amp;nbsp; When run successfully, this returns the disks integer ID and you should see it now reported against the VM's hardware with the &lt;STRONG&gt;Hard disk&lt;/STRONG&gt; &lt;EM&gt;n&lt;/EM&gt; label and the (I'm assuming Linux) VM will see it through the device file path &lt;STRONG&gt;/dev/sd&lt;/STRONG&gt;&lt;EM&gt;x&lt;/EM&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;At least, that's how it's worked for me (vSphere/vCLI 6.5.0).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2017 04:52:07 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/cli-to-create-new-virtual-disks/m-p/2651705#M1331</guid>
      <dc:creator>HDBR</dc:creator>
      <dc:date>2017-06-30T04:52:07Z</dc:date>
    </item>
  </channel>
</rss>

