I have some static ips spread out in different cidr blocks (assume 1 ip each). Now I want to create VMs out of specific ips. What I am trying to do is creating different networks (cidr /32 for each ip). However, OpenStack gives me an error The subnet in the Network Address is too small (/32).
I just want to create VMs with specific static ips and am stuck at this point for quite a while.
Asked
Active
Viewed 578 times
0

Varun Garg
- 2,464
- 23
- 37
1 Answers
1
When creating an instance, the --nic
option allows you to set the fixed IP address:
[--nic <net-id=net-uuid,v4-fixed-ip=ip-addr,v6-fixed-ip=ip-addr,port-id=port-uuid,auto,none>]
You can also add a fixed IP to an existing instance.

berndbausch
- 869
- 10
- 18
-
so, creating using v4-fixed-ip, requires you to also add port or network. creating a port also requires a network...basically everything goes back to network and exception of `The subnet in the Network Address is too small (/32)`. btw, I tried cheating (changing to /31) and created a vm with fixed ip that I had. It allocated with rihgt ip but I can't seem to ping / ssh the vm. – Varun Garg Jan 28 '21 at 09:08
-
IP addresses are attached to ports, and ports are attached to networks, so you need a port and a network to launch an instance with IP address. I don't know why you say that a /31 subnet is cheating. In any case, from where do you ping the instance? If you want to connect to it from outside its network, you need to have a route to it or assign it a floating IP. – berndbausch Jan 28 '21 at 09:20
-
Thanks. I want to ping it from outside. I mentioned /31 as cheating because I didn't own the other ip in the subnet, but that is fine. btw when I try attaching a floating ip to the local machine create in default test (local) network, I am getting `Network
is not a valid external network.`. From what I understand, it means I cant associate ip as it is a private network (10.x range). So I tried creating a network (as with /31), but I cant seem to ping the VMs. note I was able to ping using esxi setup earlier, so It is something with my openstack config. – Varun Garg Jan 28 '21 at 20:43 -
update now I am trying to create an external network with the right router (that has a public ip) – Varun Garg Jan 28 '21 at 21:07
-
update, I cant sem to add another interface to the router for the public subnet. The ui has concept of adding `interfaces` to router but docs (https://docs.openstack.org/python-openstackclient/pike/cli/command-objects/router.html) allow only adding subnet or ports. When I try adding subnet, I get `IP address <> is not a valid IP for the specified subnet.` and it refuses to add ports because they are already associated to network (which is because they are created with a network and network is same as the one that router is using). I am not sure what I am doing wrong. – Varun Garg Jan 28 '21 at 21:56
-
Floating IPs must be in the range of a subnet of an external network. I have to admit that I am not too clear what you are trying to do. Let's start with the network architecture. Are your instances attached to a provider network (without router), or a tenant network? In the latter case, you have full control of the tenant network's IP address range; no need to be stingy and use a /31 CIDR. The instance gets a so-called *fixed IP* from the tenant network. Since you can't connect to that fixed IP from outside, you also need to assign a *floating IP* to the instance. – berndbausch Jan 29 '21 at 00:10
-
For more clarity, you may want to add your steps to the question. Either CLI commands, or descriptions and possibly screenshots of your GUI steps. Perhaps a screenshot of your network topology. – berndbausch Jan 29 '21 at 00:11