Bug 1133540

Summary: "Use Foreman Hosts Providers>Provisioned Hosts" option of "new host" fails
Product: [Retired] oVirt Reporter: Netbulae <info>
Component: ovirt-engine-coreAssignee: Yaniv Bronhaim <ybronhei>
Status: CLOSED CURRENTRELEASE QA Contact: movciari
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.5CC: ecohen, gklein, iheim, info, oourfali, rbalakri, yeylon
Target Milestone: ---   
Target Release: 3.5.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: infra
Fixed In Version: ovirt-3.5.0_rc2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-17 12:42:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Netbulae 2014-08-25 12:17:18 UTC
Description of problem:

I provision an Centos 7 with vdsm etc. installed. Now I want to add it through the GUI using the "Use Foreman Hosts Providers>Provisioned Hosts" option of the "new host" dialog

Version-Release number of selected component (if applicable):
ovirt-engine-3.5.0-0.0.master.20140821064931.gitb794d66.el6.noarch

How reproducible:
Every time


Actual results:

Started PUT "/api/v2/discovered_hosts/mac*************" for xx.xxx.xxx.xxx at 2014-08-25 13:19:00 +0200
Processing by Api::V2::DiscoveredHostsController#update as JSON
  Parameters: {"discovered_host"=>{"name"=>"node4.test.nu", "hostgroup_id"=>"2", "environment_id"=>"1", "mac"=>"*:*:*:*:*:*", "domain_id"=>"1", "subnet_id"=>"1", "ip"=>"xx.xxx.xxx.xxx", "architecture_id"=>"1", "operatingsystem_id"=>"7", "medium_id"=>"1", "ptable_id"=>"12", "root_pass"=>"[FILTERED]", "host_parameters_attributes"=>[{"name"=>"host_ovirt_id", "value"=>"[FILTERED]", "_destroy"=>"false", "nested"=>""}, {"name"=>"compute_resource_id", "value"=>"[FILTERED]", "_destroy"=>"false", "nested"=>""}, {"name"=>"pass", "value"=>"[FILTERED]", "_destroy"=>"false", "nested"=>""}, {"name"=>"management", "value"=>"[FILTERED]", "_destroy"=>"false", "nested"=>""}]}, "apiv"=>"v2", "id"=>"mac*************"}
Authorized user admin(Admin User)
DHCP records node4.test.nu-*:*:*:*:*:*/xx.xxx.xxx.xxx already exists
Unprocessable entity Host::Discovered (id: 34):
  Name has already been taken
  IP address has already been taken
  Conflict DHCP records node4.test.nu-*:*:*:*:*:*8/xx.xxx.xxx.xxx already exists
  Medium CentOS mirror does not belong to CentOS 7.0 operating system

  Rendered api/v2/errors/unprocessable_entity.json.rabl within api/v2/layouts/error_layout (4.9ms)
Completed 422 Unprocessable Entity in 1929ms (Views: 9.9ms | ActiveRecord: 46.5ms)

Comment 1 Oved Ourfali 2014-08-26 07:46:16 UTC
The provisioned hosts should show you only hosts that are already provisioned in Foreman.
From the description it is not clear what you see in the UI.
Do you see a list of hosts?

Comment 2 Netbulae 2014-08-26 08:17:58 UTC
The host I already provisioned shows up fine. I can choose one from a list.

The thing that's not working is actually adding the host by pressing OK.

Foreman complains about the name and ip already been taken. That is logical because they are, but foreman shouldn't do anything with it.

The log I see: "discovered_host"=>{"name"=>"node4.test.nu"

But it isn't a discovered host as it's already deployed....

Comment 3 Oved Ourfali 2014-08-26 08:26:13 UTC
(In reply to Netbulae from comment #2)
> The host I already provisioned shows up fine. I can choose one from a list.
> 
> The thing that's not working is actually adding the host by pressing OK.
> 
> Foreman complains about the name and ip already been taken. That is logical
> because they are, but foreman shouldn't do anything with it.
> 
> The log I see: "discovered_host"=>{"name"=>"node4.test.nu"
> 
> But it isn't a discovered host as it's already deployed....

iiuc you're saying that when choosing provisioned hosts, we actually trigger bare-metal provisioning.
If that's the case then it should be handled.

Yaniv - please check that out.

Comment 4 Netbulae 2014-08-26 10:22:22 UTC
Yes that appears to be happening. I just tried it with a freshly deployed host.

Comment 5 Sandro Bonazzola 2014-10-17 12:42:22 UTC
oVirt 3.5 has been released and should include the fix for this issue.