Ask Your Question
1

Adding new allocation pool to existing network

asked 2014-11-28 02:37:20 -0500

Openstackuser2013 gravatar image

updated 2014-11-28 02:37:50 -0500

What command syntax is used to add new allocation pool for existing external network?

I assume it should be done with command neutron subnet-update but I cannot find documentation telling the right syntax. Help for subnet-update command does not provide useful information.

Version in question is Icehouse.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2014-11-28 03:25:46 -0500

dbaxps gravatar image

updated 2014-11-28 04:52:38 -0500

The way it works for me ( only update ) :-

MariaDB [neutron]> select * from  ipavailabilityranges ;
+--------------------------------------+---------------+---------------+
| allocation_pool_id                   | first_ip      | last_ip       |
+--------------------------------------+---------------+---------------+
| b6d23b61-e116-4900-973d-3d136786a3bd | 192.168.1.195 | 192.168.1.254 |
| c06e19cf-f66e-4dd5-9c01-ae59f1822be9 | 15.0.0.14     | 15.0.0.254    |
| d8505913-306a-447e-bd03-4bc3d45ce057 | 10.0.0.12     | 10.0.0.254    |
+--------------------------------------+---------------+---------------+
3 rows in set (0.00 sec)


MariaDB [neutron]> update ipavailabilityranges set first_ip='192.168.1.150' where allocation_pool_id='b6d23b61-e116-4900-973d-3d136786a3bd' ;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0



   MariaDB [neutron]> select * from  ipavailabilityranges 
   ;+--------------------------------------+---------------+---------------+
    | allocation_pool_id                   | first_ip      | last_ip       |
    +--------------------------------------+---------------+---------------+
    | b6d23b61-e116-4900-973d-3d136786a3bd | 192.168.1.150 | 192.168.1.254 |
    | c06e19cf-f66e-4dd5-9c01-ae59f1822be9 | 15.0.0.14     | 15.0.0.254    |
    | d8505913-306a-447e-bd03-4bc3d45ce057 | 10.0.0.12     | 10.0.0.254    |
    +--------------------------------------+---------------+---------------+
    3 rows in set (0.00 sec)

Verification of PK for allocation_pool_id

MariaDB [neutron]> desc ipavailabilityranges ;
+--------------------+-------------+------+-----+---------+-------+
| Field              | Type        | Null | Key | Default | Extra |
+--------------------+-------------+------+-----+---------+-------+
| allocation_pool_id | varchar(36) | NO   | PRI | NULL    |       |
| first_ip           | varchar(64) | NO   | PRI | NULL    |       |
| last_ip            | varchar(64) | NO   | PRI | NULL    |       |
+--------------------+-------------+------+-----+---------+-------+
3 rows in set (0.02 sec)
edit flag offensive delete link more

Comments

So there is no way to do it from Neutron API?

Openstackuser2013 gravatar imageOpenstackuser2013 ( 2014-11-28 03:43:44 -0500 )edit

Also can this database method be used to add pools as well? I am unsure about the "id" column. Can I just make up something for the id of new pool?

Openstackuser2013 gravatar imageOpenstackuser2013 ( 2014-11-28 04:00:47 -0500 )edit

Check whether allocation_pool_id is primary key, before trying to insert.

dbaxps gravatar imagedbaxps ( 2014-11-28 04:04:22 -0500 )edit

If it is primary key can I just pick random id for it? And what if it is not primary?

Openstackuser2013 gravatar imageOpenstackuser2013 ( 2014-11-28 05:17:33 -0500 )edit

It's PK. See updated answer. Please, don't pick random id. No inserts into table.

dbaxps gravatar imagedbaxps ( 2014-11-28 05:22:45 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-11-28 02:37:20 -0500

Seen: 445 times

Last updated: Nov 28 '14