Changed to find by id instead of using .first and .last

https://github.com/ManageIQ/manageiq/issues/200

It's been a while but I think you can use pluck, please verify this as I'm guessing:

```ruby
ids = Vm.pluck(:id)
```

See [this](http://stackoverflow.com/questions/12176102/what-is-the-difference-between-pluck-and-collect-in-rails)
and [this](http://guides.rubyonrails.org/active_record_querying.html#pluck).

Granted, performance is not really an issue here but pluck is more performant (less objects created) and is more elegant.