Thursday, May 21, 2015

vmware virtual center db queries

i need to move vms and templates. but i need to know where they are.
 i want to know what is where. like really what and really where.  
 connect to the vmware virtual center db via ms sql server manangement studio  
   
 DNS Name     IP Address     PRODUCT FULLNAME  
 vmhost          6.6.6.6          VMware ESX Server 3.5.0 build-317866  
   
 via query:  
 select DNS_Name, IP_Address, PRODUCT_FULLNAME from vpx_host Order by DNS_Name  
   
 VM/Template Name                    Storage LUN  
 sillyvmtmp                         vmhost:storage1  
 sillyvm                              vmhost:storage1  
 sillyvm2                         NAS  
   
 via query:  
 select VMS.Name, TDS.Name from vpxv_vms VMS   
 inner join vpxv_vm_datastore VVMDS on VMS.VMID = VVMDS.VM_ID   
 inner join vpx_datastore TDS on VVMDS.DS_ID = TDS.ID Order by VMS.Name  
   
 VM/Template Name                    File Path  
 sillyvmtmp                         sanfs://vmfs_uuid:666/sillyvmtmp/sillvmtemp.vmtx  
 sillyvm                              sanfs://vmfs_uuid:666/sillyvm/sillyvm.vmx  
 sillyvm2                         netfs://6.6.6.7//mnt/hellData/sillyvm2/sillyvm2.vmx  
   
 via query:  
 select VPX_ENTITY.NAME as "VM Name", VPX_VM.FILE_NAME as "File Name / Path"   
 From VPX_VM inner join VPX_Entity    
 on vpx_vm.ID = vpx_entity.ID    
 order by VPX_entity.name  
   
Post a Comment