IP Allocation not working

34 posts / 0 new
Last post
#1 Tue, 06/03/2008 - 21:27
Tito

IP Allocation not working

Hello All,

Using Virtualmin Pro

I have been trying to get IP allocation to work with no luck. I have an IP block of 16. I have 4 hosting server templates called starter, silver, gold and platinum. In each server template, I configured "Virtual IP Address" from "None" to "Listed Below" and specified my range.

Then, I went into "Networking -> Network Configuration" and added an IP range to eth0 as well.

Now, when I try to create a "Virtual Server" using any of the templates, I get "Failed to create virtual server : Could not allocate virtual IP address from range"

I have looked through the forum at what different approaches people have taken an none seem to work. I first have to try to get it to work this way before I can count on it working through AWBS.

Any ideas?

Thanks, G

Wed, 06/04/2008 - 04:46
ronald
ronald's picture

have you also tried not adding the range to eth0:0 in "Networking -> Network Configuration" ?
Just curious if that would work as the IP's should already point to that card.

or adding the IP's to "Addresses and Networking" -> Shared IP Addresses

edit
OK I made a test with one of my IP's
When creating a domain I clicked Virtual IP, added the IP and clicked (Already active)

Network interface Shared, on IP xx.xxx.xxx.15
Virtual with IP xx.xxx.xxx.36 ( Already active )

and that worked.
Not enabling (Already active) then it failed.<br><br>Post edited by: ronald, at: 2008/06/04 04:52

Wed, 06/04/2008 - 05:56 (Reply to #2)
Tito

Hmmmm....I removed the range from eth0 so there is nothing there anymore. I then checked out "Addresses and Networking" -> Shared IP Addresses but don't see why I have to add each IP there because I don't want IP's to be shared. I want IP's selected from my range that I specified in each server template under "Virtual IP Addresses"

If I try to manually create a domain and choose "Virtual with allocated IP" and then hit "create server", it fails with the following:

Failed to create virtual server : Could not allocate virtual IP address from range

Wed, 06/04/2008 - 06:04 (Reply to #3)
ronald
ronald's picture

Okay I double checked my own system and I do have the xx.xxx.xxx.36 ip (it is a second IP) to a eth0 and it is the only place this IP exists.

when creating the domain I had to enable the (active already) box else it would fail.

per haps this helps a bit

Wed, 06/04/2008 - 07:35 (Reply to #4)
Tito

Ronald,

Thanks for the help. I actually found that when I had created a range to eth0, the range still existed as active to eth0:x all across the board. I deleted each interface of eth0:x and was able to create a virtual server with an IP from the range. It choose one automatically starting from the "base" IP I told it to. :-D...YAY!!!

Now, I have to figure out why in AWBS, when creating the domain, it is still wanting to use the default shared IP instead of IP's from the range. I am on mission two now ;-)

I know this is a question for AWBS but if anyone here uses it and can tell me how they are able to have AWBS select an IP from the range I specified in VM, I will appreciate it.

Thanks,
G

Wed, 06/04/2008 - 08:42 (Reply to #5)
Tito

sighhh...AWBS support says that all AWBS does is look at the templates I have setup on the server and follows most of the instructions from there. So, in my templates, I do have Virtual IP Addresses range set but when creating the virtual server through AWBS, it still won't choose an IP from the range. It'll only choose an IP from the range if I set the virtual server manually and tell it to pick an IP from the range.

Is this just the way it is?

Wed, 06/04/2008 - 09:19 (Reply to #6)
ronald
ronald's picture

i have no experience with AWBS and I will never get it neither :p

however I do know it simply reads the VM template and there you need to enter the desired IP by hand as only you know what domain you want on which IP (if I understood you correctly).

Now if I was an extremely talented and gifted developer (and Im quite the opposite) I might be able to come up with a piece of code that tells the template to pick an IP in a specific order

per haps Joe or Jamie can help you with this.
I'm on the end of my Latin :D

Wed, 06/04/2008 - 10:01 (Reply to #7)
Tito

<b>ronald wrote:</b>
<div class='quote'>Now if I was an extremely talented and gifted developer (and Im quite the opposite) I might be able to come up with a piece of code that tells the template to pick an IP in a specific order
</div>

That is exactly what I am looking for!!! :-D I was under the impression that when you specified the IP range in each template, that it should pick up the next available IP address. If this can't be done, then the range is pointless because I would have to go in there manually and set it anyway. It doesn't matter which IP it chooses as long as it's not one that is available.

This could be a pain to manually do because now I would have to have every account in pending mode in AWBS so that I can manually setup a static address for each no order and that doesn't sound right. I am sure there is a way and I am just not setting it up correctly.

If I figure this out, which I have been at it for 2 days already, I'll post up.

Wed, 06/04/2008 - 13:11 (Reply to #8)
Joe
Joe's picture

I've asked Jamie to chime in on this thread (and to spend some time figuring out how to make IP allocation make more sense...questions in this area have been coming up a lot lately). Obviously, our IP allocation UI just doesn't make sense to people.

--

Check out the forum guidelines!

Wed, 06/04/2008 - 15:00 (Reply to #9)
Tito

Joe,

Thanks, I'll be waiting on some input from Jamie. I am still stuck ;-)

Wed, 06/04/2008 - 22:26 (Reply to #10)
Joe
Joe's picture

Virtualmin actually does all the work of bringing up the virtual IP addresses itself, so you never need to touch the Network Configuration module .. in fact, adding ranges there will just prevent it from using those IPs for your virtual domains.

The correct process for setting a range of IPs to allocate from is :

1) Go to System Settings -&gt; Server Templates -&gt; Default Settings -&gt; Virtual IP address.
2) Select the 'Listed below' radio button, and enter starting and ending IPs in the fields below it.
3) Click 'Save'
4) Back on the 'Create Virtual Server' form, you can set the 'Network interface' to 'Virtual with allocated IP'. A free IP will be chosen from the range when the domain is created, and activated on your system.

A few people have asked about this, so I'm going to have to either make this easier to find, or document it better :-)

--

Check out the forum guidelines!

Wed, 06/04/2008 - 23:46 (Reply to #11)
Tito

Jamie,

I had the range set on every server template I created except for &quot;Default Settings&quot; template. I went into every server template I created and change the radio button to &quot;From default settings&quot; and removed the range. I then went ahead and added the range ONLY in &quot;default settings&quot; template.

Now, that seems to work nice. The only thing that sucks is that AWBS, when creating the account to a particular template, won't choose and IP from the allocated range. It'll choose the default server address. I still have to go into VM and manually click on &quot;Edit Virtual Server&quot; and change it afterwards.

But, this is much better than what I had so I guess I just have to deal with it ;-)

Thanks to all of you guys for the great help.

Thu, 06/05/2008 - 03:32 (Reply to #12)
ronald
ronald's picture

that's odd because if AWBS is reading your created template and that template says choose from &quot;default settings in default template&quot; then common sense says it should behave the way you want it.

Per haps AWBS doesn't know about the default template and can not read it? Is there a way you can inform AWBS of that default template?

Thu, 06/05/2008 - 09:21 (Reply to #13)
Joe
Joe's picture

If you have different ip range in each template, whichever one is selected at domain creation time will determine the ip allocated. Of course, this assumes that AWBS allows you to select templates..

--

Check out the forum guidelines!

Sun, 06/07/2009 - 07:23 (Reply to #14)
Tito

Ronald,

I thought the same thing. There isn't a way to inform AWBS of the default template because it only reads templates that actually contain the settings for particular packages. That is why I had originally place the range in each template in VM instead of in &quot;Default Template&quot;

Now you see what I mean...lol...oh well :-\

Thu, 06/05/2008 - 12:56 (Reply to #15)
Tito

<b>jamie wrote:</b>
<div class='quote'>
If you have different ip range in each template, whichever one is selected at domain creation time will determine the ip allocated. Of course, this assumes that AWBS allows you to select templates..</div>

That is ok. I don't have a problem setting up the range and yes, AWBS does allow you to select the templates but for some reason AWBS is not selecting from the range I specify in the templates. See, now I know this should be working...dang...

Thu, 06/05/2008 - 21:58 (Reply to #16)
sgrayban

Since this is a AWBS issue and NOT virtualmin's you are asking this in the wrong place.

AWBS is a frontend to the API for virtualmin pro and since this issue works inside VM it isn't a bug for us. Asking for help on the AWBS forums instead is a better idea and get them them to work this out for you.

Sun, 06/08/2008 - 09:58 (Reply to #17)
Tito

I guess I'll just have to be patient and wait then :-)

Wed, 06/11/2008 - 17:14 (Reply to #18)
Tito

Jamie,

Thanks for the reply. I will forward that over to them. Here is what they wrote to me again while I was reading your post. I believe what Steve is asking for is what you have provided already in the previous post? I will paste that info to them and see what he says but in the meantime, here is what Steve replied with prior to me reading your post:

&quot;Basically what I need is this:

If the package is set to automatically assign an ip upon account creation (by VM), return the ip assigned in the API return so we can parse it out and store it.

Regards,
Steve&quot;

Wed, 06/11/2008 - 21:33 (Reply to #19)
Joe
Joe's picture

Let me know how they get on, or if they need any additional information from Virtualmin.

--

Check out the forum guidelines!

Thu, 06/12/2008 - 05:42 (Reply to #20)
Tito

Indeed I will...thanks!!!

Thu, 06/12/2008 - 10:32 (Reply to #21)
Tito

Jamie,

I sent the output of a server creation in debug mode to Steve at AWBS. Apparently, he says that with

&quot;- Parse the output of the create-domain API call, which will contain text like &quot;Adding virtual IP interface for 1.2.3.4&quot;

...it should show this in the debug-mode option, and it's not. He is now going to try and see if with:

&quot;- Make a separate call to list-domains with the new domain name and the multiline parameter, which will include the IP address in the output in the format &quot;IP address: 1.2.3.4&quot;

...it'll work...I'll keep you posted

Fri, 06/13/2008 - 20:51 (Reply to #22)
Tito

Jamie,

Steve has been working very hard on this one with me. He modified cengine.php and also had me run a few queries on the awbs database but no luck. I noticed the following though:

When creating a virtual server manually whether awbs or just straight from vm, it'll still grabbed the main IP address. What I am thinking is that for some reason when AWBS is creating the virtual server with the ranged IP's, it's not actually picking them because there is nothing in the system really telling it to neither in vm. Here is why I think this. If I create a virtual server manually within vm using &quot;Create Virtual Server&quot; link, I would have to select the template. Now, ideally, if I select the template, it should pick an IP from the range I specified when I created the template but it's still showing me that I must choose it explicitly in the &quot;IP address and forwarding&quot; section within &quot;Create Virtual Server&quot; or else it won't do it. By default, &quot;Network Interface&quot; is set to &quot;Shared, on MAINIPOFMYSERVER&quot;. I guess if we could somehow make it to default to &quot;Virtual with allocated IP&quot;, then both AWBS and VM wouldn't have a problem creating domains automatically with a range IP.

Fri, 06/13/2008 - 21:01 (Reply to #23)
Tito

I know this has been answered before but just want to triple check...are we sure that I DO NOT need to setup a range on my interface itself in the Webmin module &quot;Network Configuration&quot;?

Fri, 06/13/2008 - 21:35 (Reply to #24)
Joe
Joe's picture

By default, Virtualmin will use the system's main shared IP address for new domains. If you want to allocate a private IP, you need to pass the --allocate-ip parameter to create-domain.pl, or select 'Virtual with allocated IP' in the web interface.

Is AWBS setting this parameter? I'd be interested to see the full Virtualmin API command or HTTP call it is using..

Regarding the range, you do NOT need to set this up in the Network Configuration module. In fact, doing some will cause Virtualmin to not use that range of addresses, as it will assume they are already in use.

--

Check out the forum guidelines!

Sat, 06/14/2008 - 04:40 (Reply to #25)
Tito

Jamie,

I am not a perl guy so setting this parameter in VM would not be something I would want to touch. I can see if I can get someone to do so or unless if you can tell me how to place the correct values in the code.

I will talk to Steve about the API to see if you can have a look. I will get back with you.

Sat, 06/14/2008 - 08:40 (Reply to #26)
Joe
Joe's picture

You don't have to modify the code - all you need to do is pass an additional parameter to the create-domain.pl program, which is --allocate-ip

By the way , do you have an email address for the guy at AWBS you have been working with? Maybe I can contact him directly.

--

Check out the forum guidelines!

Sat, 06/14/2008 - 08:54 (Reply to #27)
Tito

I will ask Steve for an email and I will let him know that he needs to have that additional parameter passed to that program.

Sat, 06/14/2008 - 09:42 (Reply to #28)
Tito

Jamie,

Steve added the additional parameter to &quot;create-domain.pl&quot;. It is WORKINGGGGGGGGGGGGGGGGGGGG....this is niceee...I can now have AWBS create my packages automatically and also with SSL and FTP activation without worrying that it's going to grab the main servers IP!!!...very niceee...thanks to both of you for this!!!...this is now working fantastic

Fri, 06/06/2008 - 21:19
Tito

This is as far as I got with AWBS tech:

&quot;Unless VM will echo out the assigned ip to the API return, I am not sure how we can get the assigned ip in order to stuff the record in AWBS.&quot;

I don't have a clue what else to do. I don't think it's a matter of VM having to echo anything. I think it's more of a matter that AWBS just needs to let VM do it's job. Is there ANYONE out there running AWBS and VM?

Regards,
G

Sat, 06/07/2008 - 11:34 (Reply to #30)
Joe
Joe's picture

If AWBS needs to get the assigned IP after creating a domain, it could call lookup-domain.pl with the multiline parameter to get the new domain's full details.

--

Check out the forum guidelines!

Sat, 06/07/2008 - 12:06 (Reply to #31)
Joe
Joe's picture

<div class='quote'>I don't have a clue what else to do. I don't think it's a matter of VM having to echo anything. I think it's more of a matter that AWBS just needs to let VM do it's job.</div>

Be gentle with the AWBS folks, they're sensitive. ;-)

Seriously, though, they've only got a few Virtualmin-using customers right now...and a few of them have been a bit hostile in support interactions with the AWBS folks. They've been pretty good about resolving issues when it is possible to do so, and while it's still not a perfect interaction and a lot of stuff doesn't work as well as it should, I think they're beginning to take Virtualmin users more seriously as the pool of users grows. So, if we all keep working with them, letting them know about problems, and keep the communication channels open, things will continue to improve. In another six months or a year, we may find that AWBS works as well with Virtualmin as anything else they support.

--

Check out the forum guidelines!

Wed, 06/11/2008 - 15:25
Tito

Hello Joe and Jamie,

I was just discussing this topic with AWBS (for a few days already) and of course with you guys. Here is what the AWBS suggested:

&quot;In order to let VM randomly assign an ip, it would need to report back to the api the ip it assigned so we could enter that ip into AWBS.
Perhaps Jamie can add that so we can parse it out.&quot;

With that said, what would have to be done to set this in motion? If there is anything I really need working, it would be this. Here is why. If I can't have AWBS assign the IP's automatically, then I pretty much have to sit there and babysit new orders thus making IP range allocation pointless. Here is why...

At the moment, a client registers for a hosting package through AWBS. Then, I have the orders set to pending instead of running the master cron in AWBS. If I let the master cron run, it will process the order with desired template, assigning it the server shared IP instead of allocated IP. This is a problem because SSL and proftpd would fail during order creation in VM and even if I had those disabled to allow the order to go through, I would still need to go back to VM to enable them (ssl and proftp) and also tell VM to change the IP from the shared to allocated range IP availability. In other words, I am having to do things that are automated, manually. Orders that come in at night will now have to wait till morning for us to process them correctly. This defeats a lot of the automation from AWBS and VM.

Is there anything that the VM team can do with the AWBS team to get this going?

Thanks a bunch,
G

Wed, 06/11/2008 - 15:54 (Reply to #33)
Joe
Joe's picture

Virtualmin already has a couple of ways of providing the IP address assigned for new domains to AWBS. They can either :

- Parse the output of the create-domain API call, which will contain text like &quot;Adding virtual IP interface for 1.2.3.4&quot;

- Make a separate call to list-domains with the new domain name and the multiline parameter, which will include the IP address in the output in the format &quot;IP address: 1.2.3.4&quot;

Perhaps you could forward this information to them?

--

Check out the forum guidelines!

Topic locked