actually, i have read the part of codes of update_subnetpool(), and subnetpool do not support "openstack subnet pool unset" command. subnetpool just support to enlarge prefies operation:
if new_prefixes is not constants.ATTR_NOT_SPECIFIED:
orig_ip_set = netaddr.IPSet(orig_pool.prefixes)
new_ip_set = netaddr.IPSet(new_prefixes)
if not orig_ip_set.issubset(new_ip_set):
msg = _("Existing prefixes must be "
"a subset of the new prefixes")
raise n_exc.IllegalSubnetPoolPrefixUpdate(msg=msg)
new_ip_set.compact()
updated['prefixes'] = [str(prefix.cidr) for prefix in new_ip_set.iter_cidrs()]
orig_ip_set is original prefixes in database which you want to update
new_ip_set is prefixes you input from cli
the operation of updating subnetpool prefixes is just allow you to enlarge range of existing prefixes, for example:
orig_ip_set=['10.0.1.0/24','10.0.2.0/24']
new_ip_set is super set of orig_ip_set, like ['10.0.1.0/24','10.0.2.0/24','10.0.3.0'/24]
so if you want to enlarge subnetpool prefixes:
openstack subnet pool set subnetpool_id --pool-prefix 10.0.1.0/24 --pool-prefix 10.0.2.0/24 --pool-prefix 10.0.3.0/24
actually, i have read the part of codes of update_ subnetpool( ), and subnetpool do not support "openstack subnet pool unset" command. subnetpool just support to enlarge prefies operation:
if new_prefixes is not constants. ATTR_NOT_ SPECIFIED: IPSet(orig_ pool.prefixes) IPSet(new_ prefixes) set.issubset( new_ip_ set): bnetPoolPrefixU pdate(msg= msg) ip_set. compact( ) 'prefixes' ] = [str(prefix.cidr)
for prefix in new_ip_ set.iter_ cidrs() ]
orig_ip_set = netaddr.
new_ip_set = netaddr.
if not orig_ip_
msg = _("Existing prefixes must be "
"a subset of the new prefixes")
raise n_exc.IllegalSu
new_
updated[
orig_ip_set is original prefixes in database which you want to update
new_ip_set is prefixes you input from cli
the operation of updating subnetpool prefixes is just allow you to enlarge range of existing prefixes, for example: set=['10. 0.1.0/24' ,'10.0. 2.0/24' ] 1.0/24' ,'10.0. 2.0/24' ,'10.0. 3.0'/24]
orig_ip_
new_ip_set is super set of orig_ip_set, like ['10.0.
so if you want to enlarge subnetpool prefixes:
openstack subnet pool set subnetpool_id --pool-prefix 10.0.1.0/24 --pool-prefix 10.0.2.0/24 --pool-prefix 10.0.3.0/24
it's a little of absurd, haha