[openstack-dev] [nova] Updating 'scheduled_at' field of nova instances in the database.

Deepak Shetty dpkshetty at gmail.com
Tue Mar 24 06:27:09 UTC 2015


On Tue, Mar 24, 2015 at 10:58 AM, Deepthi Dharwar <
deepthi at linux.vnet.ibm.com> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150324/15f1b034/attachment.html>


More information about the OpenStack-dev mailing list