Can't import existing VM from libvirt

Hi,

We encount a error with Foreman 1.9 and our Libvirtd. Both are on CentOS 7

We done a clean install of Foreman on a libvirtd hypervisor.
If we go then in "Infrastructure" > "Compute ressources", we can see our
libvirtd hypervisor added successfuly before, and If we select "associate
VM" (we can see our VM), nothing append and we have this message: 0 VMs
associated to hosts

I check "production.log" and put logging to DEBUG in logging.xml but no
error, warning or specific message.

Do you have any idea why ? Or how we can import our existant to Foreman ? I
think if we can import our Foreman VM in Foreman, everything gonna be ok !

Thanks for your help.

Do you have a matching Host in Foreman? According to the code[1]
Foreman searches for a Host which matches the MAC of the VM, so if
you've created a bare metal Host in the Foreman UI, the association
should work fine.

[1] https://github.com/theforeman/foreman/blob/develop/app/models/compute_resources/foreman/model/libvirt.rb#L155-L157

··· On 1 December 2015 at 15:05, Fabien Morcamp wrote: > Hi, > > We encount a error with Foreman 1.9 and our Libvirtd. Both are on CentOS 7 > > We done a clean install of Foreman on a libvirtd hypervisor. > If we go then in "Infrastructure" > "Compute ressources", we can see our > libvirtd hypervisor added successfuly before, and If we select "associate > VM" (we can see our VM), nothing append and we have this message: 0 VMs > associated to hosts > > I check "production.log" and put logging to DEBUG in logging.xml but no > error, warning or specific message.

Hi Greg,

Thanks for your answer.

You were right. I create a new host as bare-metal with the @MAC of the
foreman existing VM with no provisining option.
Then I go again in compute ressource, select the VM and associate it. It
work now, I can see all VM details.

Thanks :wink:

But I encount a problem then.

When I want to open the console, I get this message:
Failed to set console: Call to virDomainUpdateDeviceFlags failed: internal
error: cannot find existing graphics device to modify

In VM propertie I have this value display for remote:
Display()

How can I change it to works with VNC ?

··· On Tuesday, December 1, 2015 at 10:37:03 AM UTC-5, Greg Sutcliffe wrote: > > On 1 December 2015 at 15:05, Fabien Morcamp > wrote: > > Hi, > > > > We encount a error with Foreman 1.9 and our Libvirtd. Both are on CentOS > 7 > > > > We done a clean install of Foreman on a libvirtd hypervisor. > > If we go then in "Infrastructure" > "Compute ressources", we can see our > > libvirtd hypervisor added successfuly before, and If we select > "associate > > VM" (we can see our VM), nothing append and we have this message: 0 VMs > > associated to hosts > > > > I check "production.log" and put logging to DEBUG in logging.xml but no > > error, warning or specific message. > > Do you have a matching Host in Foreman? According to the code[1] > Foreman searches for a Host which matches the MAC of the VM, so if > you've created a bare metal Host in the Foreman UI, the association > should work fine. > > [1] > https://github.com/theforeman/foreman/blob/develop/app/models/compute_resources/foreman/model/libvirt.rb#L155-L157 >

Now the console page can be open.

But inside, I get this error
WebSock error: [object Event]

Im VM properties, I can see that the display parameters is set to vnc(5900)

Have you an idea ?

··· On Tuesday, December 1, 2015 at 11:00:38 AM UTC-5, Fabien Morcamp wrote: > > Hi Greg, > > Thanks for your answer. > > You were right. I create a new host as bare-metal with the @MAC of the > foreman existing VM with no provisining option. > Then I go again in compute ressource, select the VM and associate it. It > work now, I can see all VM details. > > Thanks ;) > > But I encount a problem then. > > When I want to open the console, I get this message: > Failed to set console: Call to virDomainUpdateDeviceFlags failed: internal > error: cannot find existing graphics device to modify > > In VM propertie I have this value display for remote: > Display() > > How can I change it to works with VNC ? > > > On Tuesday, December 1, 2015 at 10:37:03 AM UTC-5, Greg Sutcliffe wrote: >> >> On 1 December 2015 at 15:05, Fabien Morcamp wrote: >> > Hi, >> > >> > We encount a error with Foreman 1.9 and our Libvirtd. Both are on >> CentOS 7 >> > >> > We done a clean install of Foreman on a libvirtd hypervisor. >> > If we go then in "Infrastructure" > "Compute ressources", we can see >> our >> > libvirtd hypervisor added successfuly before, and If we select >> "associate >> > VM" (we can see our VM), nothing append and we have this message: 0 VMs >> > associated to hosts >> > >> > I check "production.log" and put logging to DEBUG in logging.xml but no >> > error, warning or specific message. >> >> Do you have a matching Host in Foreman? According to the code[1] >> Foreman searches for a Host which matches the MAC of the VM, so if >> you've created a bare metal Host in the Foreman UI, the association >> should work fine. >> >> [1] >> https://github.com/theforeman/foreman/blob/develop/app/models/compute_resources/foreman/model/libvirt.rb#L155-L157 >> >

Problem solve.

It come from the SSL certificate. After add it on the store, the console is
ok.

Thanks again for your help.

··· On Tuesday, December 1, 2015 at 12:25:29 PM UTC-5, Fabien Morcamp wrote: > > Now the console page can be open. > > But inside, I get this error > WebSock error: [object Event] > > Im VM properties, I can see that the display parameters is set to vnc(5900) > > Have you an idea ? > > On Tuesday, December 1, 2015 at 11:00:38 AM UTC-5, Fabien Morcamp wrote: >> >> Hi Greg, >> >> Thanks for your answer. >> >> You were right. I create a new host as bare-metal with the @MAC of the >> foreman existing VM with no provisining option. >> Then I go again in compute ressource, select the VM and associate it. It >> work now, I can see all VM details. >> >> Thanks ;) >> >> But I encount a problem then. >> >> When I want to open the console, I get this message: >> Failed to set console: Call to virDomainUpdateDeviceFlags failed: >> internal error: cannot find existing graphics device to modify >> >> In VM propertie I have this value display for remote: >> Display() >> >> How can I change it to works with VNC ? >> >> >> On Tuesday, December 1, 2015 at 10:37:03 AM UTC-5, Greg Sutcliffe wrote: >>> >>> On 1 December 2015 at 15:05, Fabien Morcamp wrote: >>> > Hi, >>> > >>> > We encount a error with Foreman 1.9 and our Libvirtd. Both are on >>> CentOS 7 >>> > >>> > We done a clean install of Foreman on a libvirtd hypervisor. >>> > If we go then in "Infrastructure" > "Compute ressources", we can see >>> our >>> > libvirtd hypervisor added successfuly before, and If we select >>> "associate >>> > VM" (we can see our VM), nothing append and we have this message: 0 >>> VMs >>> > associated to hosts >>> > >>> > I check "production.log" and put logging to DEBUG in logging.xml but >>> no >>> > error, warning or specific message. >>> >>> Do you have a matching Host in Foreman? According to the code[1] >>> Foreman searches for a Host which matches the MAC of the VM, so if >>> you've created a bare metal Host in the Foreman UI, the association >>> should work fine. >>> >>> [1] >>> https://github.com/theforeman/foreman/blob/develop/app/models/compute_resources/foreman/model/libvirt.rb#L155-L157 >>> >>