Create and manage share network subnets

A share network subnet stores network information to create and manage shares. To create and manage your share network subnets, you can use manila client commands. You can create multiple subnets in a share network, and if you do not specify an availability zone, the subnet you are creating will be considered default by the Shared File Systems service. The default subnet spans all availability zones. You cannot have more than one default subnet per share network.

Important

In order to use share networks, the share type you choose must have the extra specification driver_handles_share_servers set to True.

Create a subnet in an existing share network

  1. Create a subnet related to the given share network

    $ manila share-network-subnet-create \
       sharenetwork1 \
       --availability-zone manila-zone-0 \
       --neutron-net-id a27160ca-5595-4c62-bf54-a04fb7b14316 \
       --neutron-subnet-id f043f4b0-c05e-493f-bbe9-99689e2187d2
    +--------------------+--------------------------------------+
    | Property           | Value                                |
    +--------------------+--------------------------------------+
    | id                 | be3ae5ad-a22c-494f-840e-5e3526e34e0f |
    | availability_zone  | manila-zone-0                        |
    | share_network_id   | 35f44d3c-8888-429e-b8c7-8a29dead6e5b |
    | share_network_name | sharenetwork1                        |
    | created_at         | 2019-10-09T04:54:48.000000           |
    | segmentation_id    | None                                 |
    | neutron_subnet_id  | f043f4b0-c05e-493f-bbe9-99689e2187d2 |
    | updated_at         | None                                 |
    | neutron_net_id     | a27160ca-5595-4c62-bf54-a04fb7b14316 |
    | ip_version         | None                                 |
    | cidr               | None                                 |
    | network_type       | None                                 |
    | mtu                | None                                 |
    | gateway            | None                                 |
    +--------------------+--------------------------------------+
    
  2. Show the share network to verify if the created subnet is attached

    $ manila share-network-show sharenetwork1
    +-----------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | Property              | Value                                                                                                                                                                                                                                                                                                                                                                                        |
    +-----------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | id                    | 35f44d3c-8888-429e-b8c7-8a29dead6e5b                                                                                                                                                                                                                                                                                                                                                         |
    | name                  | sharenetwork1                                                                                                                                                                                                                                                                                                                                                                                |
    | project_id            | 8c2962a4832743469a336f7c179f7d34                                                                                                                                                                                                                                                                                                                                                             |
    | created_at            | 2019-10-09T04:19:31.000000                                                                                                                                                                                                                                                                                                                                                                   |
    | updated_at            | None                                                                                                                                                                                                                                                                                                                                                                                         |
    | description           | Share Network created for demo purposes                                                                                                                                                                                                                                                                                                                                                      |
    | share_network_subnets | [{'id': 'be3ae5ad-a22c-494f-840e-5e3526e34e0f', 'availability_zone': 'manila-zone-0', 'created_at': '2019-10-09T04:54:48.000000', 'updated_at': None, 'segmentation_id': None, 'neutron_net_id': 'a27160ca-5595-4c62-bf54-a04fb7b14316', 'neutron_subnet_id': 'f043f4b0-c05e-493f-bbe9-99689e2187d2', 'ip_version': None, 'cidr': None, 'network_type': None, 'mtu': None, 'gateway': None}] |
    +-----------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    

Show a share network subnet

  1. Show an existent subnet in a given share network

    $ manila share-network-subnet-show \
       sharenetwork1 \
       be3ae5ad-a22c-494f-840e-5e3526e34e0f
    +--------------------+--------------------------------------+
    | Property           | Value                                |
    +--------------------+--------------------------------------+
    | id                 | be3ae5ad-a22c-494f-840e-5e3526e34e0f |
    | availability_zone  | manila-zone-0                        |
    | share_network_id   | 35f44d3c-8888-429e-b8c7-8a29dead6e5b |
    | share_network_name | sharenetwork1                        |
    | created_at         | 2019-10-09T04:54:48.000000           |
    | segmentation_id    | None                                 |
    | neutron_subnet_id  | f043f4b0-c05e-493f-bbe9-99689e2187d2 |
    | updated_at         | None                                 |
    | neutron_net_id     | a27160ca-5595-4c62-bf54-a04fb7b14316 |
    | ip_version         | None                                 |
    | cidr               | None                                 |
    | network_type       | None                                 |
    | mtu                | None                                 |
    | gateway            | None                                 |
    +--------------------+--------------------------------------+
    

Delete a share network subnet

  1. Delete a specific share network subnet

    $ manila share-network-subnet-delete \
       sharenetwork1 \
       be3ae5ad-a22c-494f-840e-5e3526e34e0f
    
  2. Verify that it has been deleted

    $ manila share-network-show sharenetwork1
    +-----------------------+-----------------------------------------+
    | Property              | Value                                   |
    +-----------------------+-----------------------------------------+
    | id                    | 35f44d3c-8888-429e-b8c7-8a29dead6e5b    |
    | name                  | sharenetwork1                           |
    | project_id            | 8c2962a4832743469a336f7c179f7d34        |
    | created_at            | 2019-10-09T04:19:31.000000              |
    | updated_at            | None                                    |
    | description           | Share Network created for demo purposes |
    | share_network_subnets | []                                      |
    +-----------------------+-----------------------------------------+
    

Share network subnet metadata

  • Set metadata items on your share network subnet during creation

     $ openstack share network subnet create sharenetwork1 \
        --property key1=value1 --property key2=value2
    +--------------------+--------------------------------------+
    | Field              | Value                                |
    +--------------------+--------------------------------------+
    | availability_zone  | None                                 |
    | cidr               | None                                 |
    | created_at         | 2024-03-28T15:22:53.291721           |
    | gateway            | None                                 |
    | id                 | 9ab933ef-f0cd-409e-8b6b-c3d34073ac44 |
    | ip_version         | None                                 |
    | metadata           | {'key1': 'value1', 'key2': 'value2'} |
    | mtu                | None                                 |
    | network_type       | None                                 |
    | neutron_net_id     | None                                 |
    | neutron_subnet_id  | None                                 |
    | segmentation_id    | None                                 |
    | share_network_id   | 35f44d3c-8888-429e-b8c7-8a29dead6e5b |
    | share_network_name | sharenetwork1                        |
    | updated_at         | None                                 |
    +--------------------+--------------------------------------+
    
  • Set metadata items on your share network subnet

    $ openstack share network subnet set sharenetwork1 \
       be3ae5ad-a22c-494f-840e-5e3526e34e0f --property key1=value1 \
       --property key2=value2
    
  • Unset share network subnet metadata

    $ openstack share network subnet unset sharenetwork1 \
       be3ae5ad-a22c-494f-840e-5e3526e34e0f --property key1