On Tue, Mar 24, 2015 at 10:58 AM, Deepthi Dharwar < [email protected]> wrote:
> On 03/23/2015 09:00 PM, Jay Pipes wrote: > > On Mon, Mar 23, 2015 at 11:18:28AM +0530, Deepthi Dharwar wrote: > >> All the VM information is stored in the instances table. > >> This includes all the time related field like scheduled_at, launched_at > etc. > >> > >> After upgrading to Juno, I have noticed that my 'scheduled_at' field > >> is not getting reflected at all in the database. I do see my VMs > >> being spawned and running just fine. However, the 'launched_at' time > >> does get reflected rightly. > >> > >> > >> MariaDB [nova]> select created_at, deleted_at, host,scheduled_at, > launched_at from instances; > >> > +---------------------+---------------------+-----------------------+--------------+---------------------+ > >> | created_at | deleted_at | host | > scheduled_at | launched_at | > >> > +---------------------+---------------------+-----------------------+--------------+---------------------+ > >> | 2015-03-09 20:00:41 | 2015-03-10 17:12:11 | localhost | > NULL | 2015-03-09 20:01:30 | > >> | 2015-03-11 05:53:13 | NULL | localhost > | NULL | 2015-03-18 19:48:12 | > >> > >> > >> Can anyone let me know if this is a genuine issue or have there been > >> a recent change in regard to updating this field ? > >> > >> I am basically trying to find as to how long a particular VM is running > on a given host. > >> I was using the current time - scheduled time for the same. > >> Is there a better way to get this value ? > > > > Use current_time - launched_at. > > 'launched_at' will give me the time a particular VM came into being. > In a scenario where the VM was launched on host H1, later migrated on to > a different host H2, 'launched_at' will not give the time the VM > has been running on host H2, where as 'scheduled_at' would have > addressed this issue or will it ? > Per the code , patch @ https://review.openstack.org/#/c/143725/2 removed scheduled_at since the function was no longer used. Googling i couldn't find more info on the history behind why these 2 fields were there to begin with. I am _not_ nova expert, but iiuc, a VM is scheduled once and changing the host as part of migration isn't scheduling, but i could be wrong too. Since your requirement is to find the time a VM lived on a host, as long as launched_at is updated post migration, it should suffice i feel ? thanx, deepak
__________________________________________________________________________ OpenStack Development Mailing List (not for usage questions) Unsubscribe: [email protected]?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
