User Tools

Site Tools


program_lang:powershell_powercli_misc

Powercli misc commands

Converted to PowerCLI that looks like:

Get-VMHost | Set-VMHostAdvancedConfiguration -Name LVM.EnableResignature -Value 1 Get-VMHost | Get-VMHostStorage -RescanAllHBA -RescanAllVMFS Get-VMHost | Set-VMHostAdvancedConfiguration -Name LVM.EnableResignature -Value 0

https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Assign-a-new-signature-via-Powercli/td-p/1852376

https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Resignature-a-VMFS-Datastore-Copy/m-p/462238

https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Creating-datastore-from-mounted-VMFS-Disk-LUN-producing/td-p/1263946

https://github.com/voletri/PowerCLI-1/blob/master/Attach-SCSILun.ps1

Get-VMhost | Select -first 1

get ALL VM snapshots

PS /usr/cmd/fcm/old> get-vm | Get-Snapshot | select vm, name, description, created, sizegb

VM          : TEST01
Name        : Originale
Description : EIF - 16/03/2018
              Before vmware tools downgrade

Created     : 3/16/2018 1:14:53 PM
SizeGB      : 0.0000290209427475929260253906
...

List VMFS

PS /usr/cmd/fcm/old> $esxcli = Get-EsxCli -VMhost $myhost  -V2
PS /usr/cmd/fcm/old> $esxcli.storage.filesystem.list.Invoke()

Free       : 46794088448
MountPoint : /vmfs/volumes/xxxxxxx-8bcefe5c
Mounted    : true
Size       : 356072996864
Type       : NFS
UUID       : xxxxxxx-8bcefe5c
VolumeName : DataStore1

Free       : 9521070080
MountPoint : /vmfs/volumes/5e15fd7b-xxxxxxx-03d5-3863bb3ec358
Mounted    : true
Size       : 15837691904
Type       : VMFS-5
UUID       : 5e15fd7b-xxxxxxx-03d5-3863bb3ec358
VolumeName : DataStore2
...
program_lang/powershell_powercli_misc.txt · Last modified: 2022/01/11 00:03 by manu