Foreman strange behaviour

Hello.

I use foreman for deploy vmware templates - templates size 5-400GB deploy time 5m-1h.
I select template, host group, ip address & etc, and click Submit.
If in deploy time i tried deploy another host, ip address for new host equivalent of previous.
Why?
In subnet settings i use Internal DB for IPAM.
Also… I use block /22 for my internal network, ip addresses above 100 is very slow suggested.

Host creation is wrapped in a DB transaction, in case of errors. So,
until the deploy is completed, the Host is not saved to the DB. Since
you use the internal DB as a source of IPs, this is expected behaviour

  • the first host isn't saved yet, so the next host gets offered the
    same next-available IP.
··· On 3 December 2015 at 14:33, Nikita Stupin wrote: > Hello. > > I use foreman for deploy vmware templates - templates size 5-400GB deploy time 5m-1h. > I select template, host group, ip address & etc, and click Submit. > If in deploy time i tried deploy another host, ip address for new host equivalent of previous. > Why? > In subnet settings i use Internal DB for IPAM.

Hi,
Just found this old conversation. I don't think an issue was created, I
will create one. I am deploying vms by cloning vmware templates, using the
REST API.
The issue appears to be exactly what Greg described. What that means is you
cannot have more than one active build request to the same subnet with IPAM
using the internal DB. This is extremely hard to enforce with multiple
users.
I am thinking of using DHCP instead to track allocations, while VMs will
still have static ips configured.
I can try to come up with a patch if I can get some hints on what the
workaround should be.
I assume it would need to work similar to DHCP assignment. As I understand,
with DHCP, the entry for a new host is created before the VM clone process
begins. And the DHCP entry is deleted as part of the rollback / cleanup if
the host creation fails.

··· On Friday, December 4, 2015 at 1:34:02 AM UTC+11, Nikita Stupin wrote: > > Hello. > > I use foreman for deploy vmware templates - templates size 5-400GB deploy > time 5m-1h. > I select template, host group, ip address & etc, and click Submit. > If in deploy time i tried deploy another host, ip address for new host > equivalent of previous. > Why? > In subnet settings i use Internal DB for IPAM. > Also… I use block /22 for my internal network, ip addresses above 100 is > very slow suggested.

>
> > Hello.
> >
> > I use foreman for deploy vmware templates - templates size 5-400GB
deploy time 5m-1h.
> > I select template, host group, ip address & etc, and click Submit.
> > If in deploy time i tried deploy another host, ip address for new host
equivalent of previous.
> > Why?
> > In subnet settings i use Internal DB for IPAM.
>
> Host creation is wrapped in a DB transaction, in case of errors. So,
> until the deploy is completed, the Host is not saved to the DB. Since
> you use the internal DB as a source of IPs, this is expected behaviour
> - the first host isn't saved yet, so the next host gets offered the
> same next-available IP.

I consider this a bug, please open an issue about it.

Thanks,
Ohad
>
> –
> You received this message because you are subscribed to the Google Groups
"Foreman users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.

··· On Dec 9, 2015 12:58, "Greg Sutcliffe" wrote: > On 3 December 2015 at 14:33, Nikita Stupin wrote: > To post to this group, send email to foreman-users@googlegroups.com. > Visit this group at http://groups.google.com/group/foreman-users. > For more options, visit https://groups.google.com/d/optout.