I have a Satellite 6 server on my test environment installed as a VM in a CentOS 7 box. I have configured the CentOS KVM as a Compute Resource and host provisioning (without any Capsule/Foreman Proxy) works just fine. However, I want to use the DHCP/DNS provided by libvirt itself in order to control the IPs/hostnames of my new boxes. According to Red Hat, Satellite 6 uses the version 1.11 of Foreman.
I followed the Red Hat documentation for external capsules as well as Foreman's documentation for the usage of libvirt as a DNS/DHCP proxy.
I have installed Satellite 6 with the following options:
satellite-installer -S satellite --foreman-proxy-dns-server kvmbox.example \ --foreman-proxy-dns-provider virsh \ --foreman-proxy-dns true \ --foreman-proxy-dhcp-server kvmbox.example \ --foreman-proxy-dhcp-provider virsh \ --foreman-proxy-dhcp true \ --foreman-proxy-dhcp-gateway eth0 \ --foreman-proxy-dhcp-interface eth0
So, /etc/foreman-proxy/settings.d/dhcp.yml is:
---
# Enable DHCP management
# Can be true, false, or http/https to enable just one of the protocols
:enabled: https
# valid providers:
# - dhcp_isc (ISC dhcp server)
# - dhcp_native_ms (Microsoft native implementation)
# - dhcp_virsh (simple implementation for libvirt)
:use_provider: dhcp_virsh
:server: kvmbox.example
# subnets restricts the subnets queried to a subset, to reduce the query time.
#:subnets: [192.168.205.0/255.255.255.128, 192.168.205.128/255.255.255.128]
And for DNS:
---
# DNS management
:enabled: https
# valid providers:
# dns_dnscmd (Microsoft Windows native implementation)
# dns_nsupdate
# dns_nsupdate_gss (for GSS-TSIG support)
# dns_virsh (simple implementation for libvirt)
:use_provider: dns_virsh
# use this setting if you want to override default TTL setting (86400)
:dns_ttl: 86400
My foreman-proxy configuration seems just fine. However, when I try to create a new host, I see the following error:
Create DHCP Settings for z1.example.com task failed with the following
error: ERF12-6899 [ProxyAPI::ProxyException]: Unable to set DHCP entry
([RestClient::BadRequest]: 400 Bad Request) for Capsule
https://satellite.example.com:9090/dhcp
The /var/log/foreman-proxy/proxy.log has the following entries:
E, [2016-12-07T16:21:35.043048 #31931] ERROR -- : DHCP virsh provider > error: unable to retrive virsh info: virsh provider error: virsh call > failed (pid 32091 exit 1) - error: failed to connect to the hypervisor error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory
So, from these error logs and the lack of configuration options (as the *_virsh) files mentions, it seems that the only scenario in which I can use the libvirt DHCP/DNS functionality, (at least with Satellite 6.2/Foreman 1.11) is when Satellite/Foreman is installed on the Physical box, not as VM...
Is that true, or I just miss something?
0 Answers