<?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: get harddisk sharing mode, and storage policy in VMware PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/get-harddisk-sharing-mode-and-storage-policy/m-p/2315856#M83334</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. There is no cmdlet for that if that is what you mean by 'simple' command.&lt;BR /&gt;You need to call the API method&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. After a Get-HardDisk you can get the sharing mode via a calculated property&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #c792ea;"&gt;@&lt;/SPAN&gt;{&lt;SPAN style="color: #82aaff;"&gt;N&lt;/SPAN&gt;&lt;SPAN style="color: #c792ea;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d9f5dd;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: #ecc48d;"&gt;HDSharingMode&lt;/SPAN&gt;&lt;SPAN style="color: #d9f5dd;"&gt;'&lt;/SPAN&gt;;&lt;SPAN style="color: #82aaff;"&gt;E&lt;/SPAN&gt;&lt;SPAN style="color: #c792ea;"&gt;=&lt;/SPAN&gt;{$_&lt;SPAN style="color: #addb67;"&gt;.ExtensionData.Backing.Sharing&lt;/SPAN&gt;}}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can find the storage policy for harddisks with the &lt;A href="https://vdc-repo.vmware.com/vmwb-repository/dcr-public/6bd6daa3-08a8-4660-9159-23265b9d6c00/4d533cf0-f009-4fa0-8679-8d505fbe846b/doc/Get-SpbmEntityConfiguration.html"&gt;Get-SpbmEntityConfiguration&lt;/A&gt; cmdlet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN style="color: #7fdbca;"&gt;Get-VM&lt;/SPAN&gt; &lt;SPAN style="color: #c792ea;"&gt;-&lt;/SPAN&gt;Name MyVM &lt;SPAN style="color: #7fdbca;"&gt;|&lt;/SPAN&gt; &lt;SPAN style="color: #7fdbca;"&gt;Get-HardDisk&lt;/SPAN&gt; &lt;SPAN style="color: #7fdbca;"&gt;|&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="color: #7fdbca;"&gt;Get-SpbmEntityConfiguration&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Sep 2020 09:22:35 GMT</pubDate>
    <dc:creator>LucD</dc:creator>
    <dc:date>2020-09-29T09:22:35Z</dc:date>
    <item>
      <title>get harddisk sharing mode, and storage policy</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/get-harddisk-sharing-mode-and-storage-policy/m-p/2315855#M83333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two inquiries please:&lt;/P&gt;&lt;P&gt;1- I 'm creating a lot of VMDKs, and I need a simple command to enable "multi-writer" mode. I came across a complicated script that I have no time now to tune ot, so, I hope I get a simple command to achieve this.&lt;/P&gt;&lt;P&gt;2- I need to query the disks and list )select) their sharing mode, and current storage policy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:01:27 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/get-harddisk-sharing-mode-and-storage-policy/m-p/2315855#M83333</guid>
      <dc:creator>MRoushdy</dc:creator>
      <dc:date>2020-09-29T09:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: get harddisk sharing mode, and storage policy</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/get-harddisk-sharing-mode-and-storage-policy/m-p/2315856#M83334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. There is no cmdlet for that if that is what you mean by 'simple' command.&lt;BR /&gt;You need to call the API method&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. After a Get-HardDisk you can get the sharing mode via a calculated property&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #c792ea;"&gt;@&lt;/SPAN&gt;{&lt;SPAN style="color: #82aaff;"&gt;N&lt;/SPAN&gt;&lt;SPAN style="color: #c792ea;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d9f5dd;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: #ecc48d;"&gt;HDSharingMode&lt;/SPAN&gt;&lt;SPAN style="color: #d9f5dd;"&gt;'&lt;/SPAN&gt;;&lt;SPAN style="color: #82aaff;"&gt;E&lt;/SPAN&gt;&lt;SPAN style="color: #c792ea;"&gt;=&lt;/SPAN&gt;{$_&lt;SPAN style="color: #addb67;"&gt;.ExtensionData.Backing.Sharing&lt;/SPAN&gt;}}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can find the storage policy for harddisks with the &lt;A href="https://vdc-repo.vmware.com/vmwb-repository/dcr-public/6bd6daa3-08a8-4660-9159-23265b9d6c00/4d533cf0-f009-4fa0-8679-8d505fbe846b/doc/Get-SpbmEntityConfiguration.html"&gt;Get-SpbmEntityConfiguration&lt;/A&gt; cmdlet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN style="color: #7fdbca;"&gt;Get-VM&lt;/SPAN&gt; &lt;SPAN style="color: #c792ea;"&gt;-&lt;/SPAN&gt;Name MyVM &lt;SPAN style="color: #7fdbca;"&gt;|&lt;/SPAN&gt; &lt;SPAN style="color: #7fdbca;"&gt;Get-HardDisk&lt;/SPAN&gt; &lt;SPAN style="color: #7fdbca;"&gt;|&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="color: #7fdbca;"&gt;Get-SpbmEntityConfiguration&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:22:35 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/get-harddisk-sharing-mode-and-storage-policy/m-p/2315856#M83334</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2020-09-29T09:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: get harddisk sharing mode, and storage policy</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/get-harddisk-sharing-mode-and-storage-policy/m-p/2315857#M83335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Boss&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:43:55 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/get-harddisk-sharing-mode-and-storage-policy/m-p/2315857#M83335</guid>
      <dc:creator>MRoushdy</dc:creator>
      <dc:date>2020-09-29T09:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: get harddisk sharing mode, and storage policy</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/get-harddisk-sharing-mode-and-storage-policy/m-p/2919166#M107427</link>
      <description>&lt;P&gt;Hi LucD!&lt;/P&gt;&lt;P&gt;This was very useful for me. I am trying to generate a list of all hosts which I need to patch (everything not presently running 7.0.3c) which contain VMs which have shared multi-writer disks. The following works:&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Get-VMHost | Where-Object {$_.version -notmatch "7.0.3"} | get-vm -PipelineVariable vm | Get-HardDisk | Where-Object {$_.ExtensionData.Backing.Sharing -in 'sharingMultiWriter'} | Select Parent,@{N='VMHost';E={$vm.VMHost.Name}} | Out-Default&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This only issue is that VMs which have mutliple shared disks appear in the output mulitple times. Is there a way to prune the output so that the result only appears once?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 15:52:29 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/get-harddisk-sharing-mode-and-storage-policy/m-p/2919166#M107427</guid>
      <dc:creator>dbutch1976</dc:creator>
      <dc:date>2022-07-18T15:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: get harddisk sharing mode, and storage policy</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/get-harddisk-sharing-mode-and-storage-policy/m-p/2919171#M107428</link>
      <description>&lt;P&gt;With Sort-Object and the Unique switch&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;Get-VMHost | Where-Object {$_.version -notmatch "7.0.3"} | 
Get-VM -PipelineVariable vm | 
Get-HardDisk | 
Where-Object {$_.ExtensionData.Backing.Sharing -in 'sharingMultiWriter'} | 
Select Parent,@{N='VMHost';E={$vm.VMHost.Name}} | 
Sort-Object -Property Parent -Unique |
Out-Default&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 18 Jul 2022 16:25:35 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/get-harddisk-sharing-mode-and-storage-policy/m-p/2919171#M107428</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2022-07-18T16:25:35Z</dc:date>
    </item>
  </channel>
</rss>

