quattor / aquilon

Configuration Management Database (3rd Generation)
www.quattor.org
Apache License 2.0
14 stars 19 forks source link

1.12.66: how to change an interface address #128

Open jouvin opened 5 years ago

jouvin commented 5 years ago

I need to change the address associated with a host interface. aq update interface help says that it should be done with add add/del interface address. But if I try to add an address to the interface with:

 aq add interface address --hostn testaq.lal.in2p3.fr --int eth0 --ip 134.158.76.96

I get the error:

Bad Request: Public Interface eth0 of machine testaq.lal.in2p3.fr already has an IP address.

and if I try to delete the existing address first with:

lx6/jouvin % aq del interface address --hostn testaq.lal.in2p3.fr --int eth0 --ip 134.158.76.239

I get:

Bad Request: The primary IP address of a hardware entity cannot be removed.

What did I do wrong?

jrha commented 5 years ago

If it is the primary address, I believe you have to delete and re-add the host.

jouvin commented 5 years ago

I find it a little bit cumbersome to have to delete/re-add a host to change its primary address... Any good reason for this or is it something that we could improve?

jrha commented 5 years ago

No idea, design decision? @ned21 might have an idea about the motivation behind it. At RAL we don't normally allow hosts to be renamed because it causes a record keeping nightmare.

gombasg commented 5 years ago

If it is not the primary address, then you need to delete/re-add it. If it is the primary address, then a little un-intuitively, aq update machine --machine ... --ip ... is what you need.

jouvin commented 5 years ago

@gombasg thanks for the info, I'll add it to the documentation. BTW, if it is not the primary address you need to delete/readd the interface address (according to the help), not the host, isn't it?