Hi,
So i've got 2 very similar commands that to override the subnet being used
by a host in foreman.
- It looks like i have to manually set an ip or the command entirely fails.
- On Vsphere the command is successful although i'm seeing a 500 error
when trying to power up the machine - will investigate separately. - On Rhev Virtualization Platform the command fails DHCP entry already
exists.
Behaviour in both cases is similar to using the GUI, however you can
specify overwrite in GUI in 2 places for Rhev (on the interface selection
page and when you submit the host details) to override the DHCP entry
already exists error.
These are the input params, the ip address when calling is valid for the
subnet.
input_params = {
subnet_id: 40,
ip: "x.x.x.x",
domain_id: 1,
overwrite: true
}
Where i need help is understanding why the overwrite parameter is not
working for Rhev platform.
Also any help understanding any other other parameters that I might need.
In the initial request to create the host i'm setting all these values
managed: true,
primary: true,
provision: true,
rebuild: "true",
overwrite: true
Finally this is the command i'm using to update the interface
config = { uri: endpoint_foreman_id,
username: endpoint_foreman_user,
password: endpoint_foreman_password,
api_version: 2 }
api = ApipieBindings::API.new(config)
#this_id is the id of the host i want to update
#input_params is from above
#interface_id is the id of the interface i want to update
api.resource(:interfaces).action(:update).call(id: interface_id, host_id:
this_id, interface: input_params)