Question
How can I easily tell which schedule goes to which VM from the database?
Environment
OnApp 2.x, 3.x
Answer
***Please see this article for additional details about working with the OnApp database***
https://onapp.zendesk.com/entries/22073502-mysql-how-to-access-the-mysql-database-in-onapp
This query will show you a virtual machine's schedule. You must replace the ########### with the virtual machine identifier, or remove the 'WHERE v.identifier="###########"' entirely which will show you ALL of the virtual machine's schedules.
SELECT v.label "Virtual Machine", s.id "Sched ID", s.period "Period", s.start_at "Next Start" FROM schedules s JOIN disks d ON s.target_id=d.id JOIN virtual_machines v ON d.virtual_machine_id=v.id WHERE v.identifier="###########" ORDER BY v.label, s.start_at;
Produces output such as:
+-----------------+----------+--------+---------------------+
| Virtual Machine | Sched ID | Period | Next Start |
+-----------------+----------+--------+---------------------+
| Test VM | 6 | days | 2014-01-26 17:57:39 |
| Test VM | 7 | weeks | 2014-01-29 17:57:39 |
| Test VM | 8 | months | 2014-02-14 17:57:39 |
| Test VM | 9 | years | 2014-11-14 17:57:39 |
+-----------------+----------+--------+---------------------+
Comments
0 comments
Please sign in to leave a comment.