VMware Cloud Community
td_sk
Contributor
Contributor
Jump to solution

need to check multiwriter is enabled in VM

Hi All,

   Thanks in Advance.

   For creating build verification documents, I need to check if the particular VM is enabled with multi writer disk's or not .Any help much appreciated.

I need a report some thing like the following.

   

Header 1Header 2Header 3Header 2
Capacity GBStorageFormatFilenameMulti-writer
40 GBEagerZeroedThick[LUN-1]vmtest.vmdkno
60 GBEagerZeroedThick[LUN-1]vmtest_1.vmdkyes
24 Replies
LucD
Leadership
Leadership
Jump to solution

In 6.5 the Backing property seems to work.

multi.png

So it looks like in 6 one needs to check the VMX (I'll verify that in any case)


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

LucD
Leadership
Leadership
Jump to solution

On 6 the Backing seems to provide the multi-writer state as well.

Only until 5.5 do you need to access the VMX (through the Get-AdvancedSettings cmdlet).

The following script test the version, and retrieves the setting accordingly

Get-VM | Get-HardDisk | %{

    $ctrl = Get-ScsiController -HardDisk $_

    $_ | Select @{N='VM';E={$_.Parent.Name}},

        Name,

        StorageFormat,

        FileName,

        @{N='Multi-Writer';E={

            if($_.Parent.VMHost.ApiVersion -le "5.5"){

                $ctrl = Get-ScsiController -HardDisk $_

                Get-AdvancedSetting -Entity $_.Parent -Name "scsi$($ctrl.ExtensionData.BusNumber):$($_.ExtensionData.UnitNumber).sharing" |

                Select -ExpandProperty Value

            }

            else{

                $_.ExtensionData.Backing.Sharing

            }

       }}

}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Vel_VMware
Enthusiast
Enthusiast
Jump to solution

Excellent, thanks a lot for your effort, its working as I expected.

0 Kudos
Vel_VMware
Enthusiast
Enthusiast
Jump to solution

Hi LuCD,

Hope you are doing good.

After long break coming back to same thread. You have provided me the script to get "Multiwriter" has been enabled for VM's. Thats works great too.

I just want to have the same kind of script to get same "Multiwriter" has been enabled for specific list of VM's. Which means I would be having the list of VM's in .csv format and providing this an input and it has to get whether those VM's are enabled with "Multiwriter" or not.

Can you please help me on this..

Thanks in advance

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Sure, but I suggest you open a new thread for that.
That makes it easier for others to find it.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos