Manila/IPv6

= Recipe for Devstack with IPv6 =

In order to test the Manila IPv6 patches you need to be able to get IPv6 working with your devstack. Here is what I do.

VM setup
I use 2 networks for my devstack VMs. The "front end" network is connected to the outside world. The "back end" network is completely isolated. I use the front end network for management and the back end network for devstack's "public" network (even though that may not be the intended design).

Front end

devstacknet_fe                 <host id="00:03:00:01:52:54:00:00:30:02" name="cache" ip="fd30::2" /> <host id="00:03:00:01:52:54:00:00:30:03" name="stage1" ip="fd30::3" /> <host id="00:03:00:01:52:54:00:00:30:04" name="stage2" ip="fd30::4" /> <host id="00:03:00:01:52:54:00:00:30:05" name="openstack1" ip="fd30::5" /> <host id="00:03:00:01:52:54:00:00:30:06" name="openstack2" ip="fd30::6" /> </ip>

Back end

<network ipv6='yes'> devstacknet_be <bridge name='devstacknet1' stp='on' delay='0'/> <mac address='52:54:00:00:31:01'/>

My VM is an Ubuntu Xenial VM with 2 NICs.

<domain type='kvm'> openstack1 <memory unit='GiB'>4 <currentMemory unit='GiB'>4</currentMemory> 2   <cpu mode='host-passthrough'> <os> <type arch='x86_64'>hvm <boot dev='hd'/> </os> <clock offset='utc' /> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> &lt;source file='/vmdata/openstack1.qcow2'/> <target dev='vda' bus='virtio'/> <interface type='network'> <mac address='52:54:00:00:30:05'/> &lt;source network='devstacknet_fe'/> <model type='virtio'/> <interface type='network'> &lt;source network='devstacknet_be'/> <mac address='52:54:00:00:31:02'/> <model type='virtio'/> <graphics type='vnc' port='-1' autoport='yes'/> <model type='vmvga' vram='16384' heads='1'/> <memballoon model='virtio' />

Inside the VM I configure my network like this:

$ cat /etc/network/interfaces auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp iface eth0 inet6 dhcp auto eth1 iface eth1 inet manual up ip link set dev eth1 up    down ip link set dev eth1 down

I also force the DUID to the DUID-LL format rather than DUID-LLT so I can have a predictable IPv6 address. This step doesn't matter if you're willing to look up which IPv6 address you got each time.

$ head -n 1 /var/lib/dhcp/dhclient6.eth0.leases default-duid "\000\003\000\001RT\000\0000\005";

Outside the VM (on the hypervisor) I setup a route to ensure that the nova VMs will be able to talk to the hypervisor:

sudo ip -6 route replace fd10::/15 via fd30::5 dev devstacknet0

Devstack setup
Clone repos: sudo mkdir /opt/stack sudo chown $USERNAME:$USERNAME /opt/stack cd /opt/stack git clone https://github.com/openstack-dev/devstack git clone https://github.com/openstack/manila git clone https://github.com/openstack/python-manilaclient

Create local.conf:

localrc HOST_IP=192.168.30.5 ADMIN_PASSWORD=camacho DATABASE_PASSWORD=camacho RABBIT_PASSWORD=camacho SERVICE_PASSWORD=camacho SERVICE_TOKEN=camacho GUEST_PASSWORD=camacho MYSQL_HOST=127.0.0.1 MYSQL_USER=root MYSQL_PASSWORD=nova RABBIT_HOST=127.0.0.1 LOGDAYS=1 LOGFILE=$DEST/devstack.log SCREEN_LOGDIR=$DEST/logs/screen RECLONE=False LOG_COLOR=False LIBVIRT_TYPE=kvm IP_VERSION=4+6 DOWNLOAD_DEFAULT_IMAGES=False LIBS_FROM_GIT=python-manilaclient enable_plugin manila git://git.openstack.org/openstack/manila MANILA_MULTI_BACKEND=True MANILA_BACKEND1_CONFIG_GROUP_NAME=vienna MANILA_BACKEND2_CONFIG_GROUP_NAME=prague MANILA_SHARE_BACKEND1_NAME=Vienna MANILA_SHARE_BACKEND2_NAME=Prague IMAGE_URLS=http://192.168.30.2/manila-test.img SHARE_DRIVER=manila.share.drivers.lvm.LVMShareDriver MANILA_OPTGROUP_vienna_driver_handles_share_servers=False MANILA_OPTGROUP_prague_driver_handles_share_servers=False MANILA_OPTGROUP_vienna_lvm_share_volume_group=lvm-shares1 MANILA_OPTGROUP_prague_lvm_share_volume_group=lvm-shares2 MANILA_LVM_SHARE_EXPORT_IP=fd30::5 ENABLED_SERVICES=key,mysql,rabbit,tempest,manila,m-api,m-sch,m-shr,m-dat,q-svc,q-dhcp,q-meta,q-agt,q-l3,neutron,n-api,n-cond,n-cpu,n-sch,g-api,g-reg Q_USE_PROVIDERNET_FOR_PUBLIC=True PUBLIC_INTERFACE=eth1 Q_USE_SECGROUP=False IPV4_ADDRS_SAFE_TO_USE=10.0.0.0/22 IPV6_RA_MODE=dhcpv6-stateful IPV6_ADDRESS_MODE=dhcpv6-stateful IPV6_ADDRS_SAFE_TO_USE=fd10::/16 FIXED_RANGE_V6=fd10::/64 IPV6_PUBLIC_RANGE=fd11::/64 IPV6_PUBLIC_NETWORK_GATEWAY=fd11::2
 * 1) HOSP_IP comes from DHCP, it's predictable
 * 1) This image is the "client" image built from openstack/manila-test-image and
 * 2) uploaded to a cache server.
 * 1) This export IP comes from DHCPv6, it's predictable

Before stacking I create my backing files explicitly:

mkdir /opt/stack/data truncate -s 100g /opt/stack/data/lvm-shares1-backing-file truncate -s 100g /opt/stack/data/lvm-shares2-backing-file sudo vgcreate lvm-shares1 \$(sudo losetup -f --show /opt/stack/data/lvm-shares1-backing-file) sudo vgcreate lvm-shares2 \$(sudo losetup -f --show /opt/stack/data/lvm-shares2-backing-file)

Now I run stack.sh and go get coffee.

Testing
After stacking, I run these commands:

source /opt/stack/devstack/openrc demo demo > /dev/null openstack network create demo-net POOL6=$(openstack subnet pool list | grep fd10::/16 | awk '{print $2}') openstack subnet create --ip-version 6 demo-v6-subnet --network demo-net --subnet-pool $POOL6 --ipv6-ra-mode dhcpv6-stateful --ipv6-address-mode dhcpv6-stateful POOL4=$(openstack subnet pool list | grep 10.0.0.0/22 | awk '{print $2}') openstack subnet create --ip-version 4 demo-v4-subnet --network demo-net --subnet-pool $POOL4 openstack router add subnet router1 demo-v6-subnet openstack router add subnet router1 demo-v4-subnet openstack keypair create --public-key ~/.ssh/id_rsa.pub demo-key nova boot --flavor cirros256 --image manila-test --nic net-name=demo-net --key-name demo-key --config-drive true demo-vm

Once the nova VM boots up I use "nova list" to get its IPv6 address and I can SSH to it from either the devstack VM or the hypervisor, and the nova VM is able to ping both the destack VM and the hypervisor, and perform mounts over IPv6, etc.