Project

General

Profile

Actions

Bug #2093

closed

vmware compute resources don't support folders

Added by Kevin Cormier almost 12 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Category:
VM management
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

When using vmware compute resources, any VMs inside of folders are not detected by foreman.

I found this with Foreman 1.1RC3.

Actions #1

Updated by Kevin Cormier almost 12 years ago

I forgot to mention this was reproduced with vmware vsphere 5.1.0. Running foreman installed via rpm on a vanilla CentOS 6.3 box fully patched.

Actions #2

Updated by Ohad Levy almost 12 years ago

Sam, I had a few minutes to play, its not complete (UI part) but working:

http://pastie.org/5615993

Actions #3

Updated by Duncan Innes about 11 years ago

Any chance of the priority of this being raised a bit?

As far as VMware is concerned, I've not worked at any sites where folders were not used in some way.

Actions #5

Updated by Dominic Cleal about 11 years ago

  • Status changed from New to Ready For Testing
  • Assignee changed from Sam Kottler to Martin Matuška
  • Target version set to 1.4.0
Actions #6

Updated by Duncan Innes about 11 years ago

I'm getting errors after applying this patch:

There was an error listing VMs: No route matches {:action=>"show", :controller=>"compute_resources_vms", :compute_resource_id=>#<Foreman::Model::Vmware id: 1, name: "Datacentre_1", description: "", url: "vspherehost.domain.com", user: "DOMAIN\\username", password: "secret", uuid: "Gotts Road", type: "Foreman::Model::Vmware", created_at: "2013-09-17 10:39:19", updated_at: "2013-09-17 10:40:29", attrs: {:setpw=>0, :pubkey_hash=>"8b12a6aa3993211aa3bf66f00dd18225c299b8be2b9dd967a37a5f2720733f33"}>, :id=>nil}

What else can I provide to help with this?

Actions #7

Updated by Dominic Cleal about 11 years ago

Duncan, could you try applying this patch on top and then paste the new error you get? https://gist.github.com/6620345

The issue here is the last "id" field in the error, which is showing :id => nil. This indicates that one of the VMs we're reading back from vSphere is missing a UUID, so I guess there's some strange type of VM coming back from the API that we should ignore and skip while listing. The patch above will make it list the VM's name, so if you can find it in vSphere and tell us a bit more about it - we might be able to work out what to do then.

Actions #8

Updated by Duncan Innes about 11 years ago

OK - patched and re-run.

"There was an error listing VMs: vm: W2K8 Template (, VirtualMachine("vm-3776"))"

Not sure if it's the first template that the code will have come across as we've got several in this Datacenter. Don't think there's anything special about it compared to other templates. I had a quick check and didn't see anything different.

Do templates have UUID?

Actions #9

Updated by Dominic Cleal about 11 years ago

Strange, the templates on the vSphere 5.1.0 instance I can see all have UUIDs and show up in the VM list.

Martin, maybe we can change the all method to skip over entries where vm.identity.nil?.

Actions #10

Updated by Duncan Innes about 11 years ago

Can a blank UUID be replaced with "<Unknown>" at all? I'd rather have systems/templates like this displayed rather than being missing from the Foreman screen, but showing in vSphere. Hiding them in Foreman is just going to create confusion at the user end.

Actions #11

Updated by Ohad Levy about 11 years ago

Duncan Innes wrote:

Can a blank UUID be replaced with "<Unknown>" at all? I'd rather have systems/templates like this displayed rather than being missing from the Foreman screen, but showing in vSphere. Hiding them in Foreman is just going to create confusion at the user end.

afair, templates should not be shown under the vm tab, if they do, its a bug.

Actions #12

Updated by Ohad Levy about 11 years ago

Dominic Cleal wrote:

Duncan, could you try applying this patch on top and then paste the new error you get? https://gist.github.com/6620345

The issue here is the last "id" field in the error, which is showing :id => nil. This indicates that one of the VMs we're reading back from vSphere is missing a UUID, so I guess there's some strange type of VM coming back from the API that we should ignore and skip while listing. The patch above will make it list the VM's name, so if you can find it in vSphere and tell us a bit more about it - we might be able to work out what to do then.

Dominic, I guess we should handle errors better in this case, I personally had a similar issue with the association fails on a 'bad' vm.. many times this can happen because of another bug (e.g. its a template that shown as a vm) or if its a very old vm that its config has not been updated (or it was imported but never started etc).

Actions #13

Updated by Duncan Innes about 11 years ago

Ohad Levy wrote:

afair, templates should not be shown under the vm tab, if they do, its a bug.

Fair point. Could live with this being a list of VM's only for now.

If/when Foreman becomes interested in deploying VM's from templates, a solution would need to be found. Perhaps another tab for Templates? Or a combined tab that shows a tree view of folders, sub-folders etc and the contained VM's/Templates.

Actions #14

Updated by Dominic Cleal about 11 years ago

Sounds like we've got a few related issues then with empty UUIDs. Excluding templates from the list and showing VMs without UUIDs as "unknown" sounds like a sensible compromise, and skipping over VMs during association (and other times we iterate) with missing UUIDs. I think we need a new # for these bits.

Actions #15

Updated by Duncan Innes about 11 years ago

Dominic Cleal wrote:

Excluding templates from the list and showing VMs without UUIDs as "unknown" sounds like a sensible compromise

Sounds like a way forward to me. I'll test whatever code is available as soon as I can.

Actions #16

Updated by Dominic Cleal about 11 years ago

  • Target version changed from 1.4.0 to 1.3.1
Actions #17

Updated by Martin Matuška about 11 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #18

Updated by Greg Sutcliffe about 11 years ago

  • Translation missing: en.field_release set to 1
Actions #19

Updated by Duncan Innes about 11 years ago

Just upgraded to 1.3.0 and tried this patch.

Works a charm. Cheers.

Actions

Also available in: Atom PDF