Jamyy's Weblog

VMware: 找出含有 Snapshot 的 VM、解決無法 Storage vMotion 的問題

by Jamyy on 九月.14, 2016, under VMware

  • 在 ESXi Shell 找出所有 "含有 snapshot" 的 VM
  • 解決 Storage vMotion 出現 "The method is disabled by 'vm-xx'" 而無法執行的問題

環境: VMware vSphere 6.0, vCenter Server @ Windows Server 2012 R2

在 ESXi Shell 找出所有 "含有 snapshot" 的 VM

$ ssh root@esxi.host

] find /vmfs/volumes/datastore -type f -name '*.vmx' -exec egrep -i "scsi[0-9]+:[0-9]+.present|scsi.*filename" {} \; | grep "0001\.vmdk"

scsi0:0.fileName = "vm1-000001.vmdk"
scsi0:0.fileName = "vm2-000001.vmdk"
scsi0:0.fileName = "vm3-000001.vmdk"
scsi0:0.fileName = "vm4-000001.vmdk"
scsi0:0.fileName = "vm5-000001.vmdk"

Ref: Determining if a virtual machine is using snapshots (1004343) | VMware KB<

解決 Storage vMotion 出現 "The method is disabled by 'vm-xx'" 而無法執行的問題

假設執行 Storage vMotion 時出現錯誤訊息: The method is disabled by 'vm-86'

找出 PostgreSQL 帳號密碼
C:\> type C:\ProgramData\VMware\vCenterServer\cfg\vmware-vpx\vcdb.properties

driver = org.postgresql.Driver
dbtype = PostgreSQL
url = jdbc:postgresql://localhost:5432/VCDB
username = vc
password = PASSWORD
password.encrypted = false

停止 vpxd 服務
C:\> net stop vpxd

登入 PostgreSQL
C:\> "\Program Files\VMware\vCenter Server\vPostgres\bin\psql.exe" -d VCDB vc
Password for user vc: 貼上剛剛查到的密碼

刪除錯誤訊息提示的內容
VCDB=> select * from VPX_DISABLED_METHODS where ENTITY_MO_ID_VAL = 'vm-86';
VCDB=> delete from VPX_DISABLED_METHODS where ENTITY_MO_ID_VAL = 'vm-86';
VCDB=> \q

恢復 vpxd 服務
C:\> net start vpxd

Ref:



:,