Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloning a template while providing multiple ips in the same network, will create a VM with multiple interfaces having the same IP Address #75

Open
ciorceri opened this issue Nov 7, 2016 · 5 comments

Comments

@ciorceri
Copy link
Contributor

ciorceri commented Nov 7, 2016

Clone a template:
./bin/ezmomi clone --template some_template --hostname new_vm --domain some_domaine --ips 192.168.0.10 192.168.0.11 192.168.0.12

The new created VM will have 3 network interfaces and all of them will use the same IP (the last one): 192.168.0.12.

The issue is in file ezmomi.py, around line 185

        for network in self.config['networks']:
            if ip in IPNetwork(network):
                self.config['networks'][network]['ip'] = ip

Where a configured network can have only one IP Address.

@snobear
Copy link
Owner

snobear commented Nov 7, 2016

@ciorceri thats strange, i use multiple IPs all of the time and it creates separate NICs with each of the listed ips. Questions:

  • what version of ezmomi? ezmomi --version to check that
  • what OS distro and version are you cloning?

@ciorceri
Copy link
Contributor Author

ciorceri commented Nov 8, 2016

@snobear
I'm using version 6.3.0, and I'm deploying from template a RHEL7 distro.
Probably my description was not very clear so I will try again.

In my env I have only ONE VLAN and I wanted to add in the clone few interfaces using IP's from the same network.

Anyway, I've spot where is the issue and I will try to fix it in my branch and I will do a pull request here in the future.

@snobear
Copy link
Owner

snobear commented Nov 8, 2016

@ciorceri OK I see. Thanks for investigating a potential fix!

@snobear
Copy link
Owner

snobear commented Jan 21, 2017

I ran into this today, actually. And your title and description was very clear actually, I just wasn't getting it originally :). I was putting up two interfaces in the same network today, and, as your issue title says, the two interfaces end up with the same ipaddress. I guess I've rarely had to do that.

A PR would would very appreciated, BUT even if you have just have a tiny bit of time to add a quick description of the code issue here, then I can implement it.

@ciorceri
Copy link
Contributor Author

ciorceri commented Jan 21, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants