Question


How can I find all virtual servers using the same data store?


Environment


All OnApp versions


Answer


Please refer to the Access the MySQL Database in OnApp page for additional details about working with the OnApp database.

To find all virtual servers, use the specific data_store and replace xx with the desired data_store_id:

SELECT v.label, v.id, v.hypervisor_id, d.data_store_id FROM virtual_machines v JOIN disks d ON v.id = d.virtual_machine_id JOIN data_stores s ON s.id = d.data_store_id WHERE d.data_store_id = xx;
CODE