Commit 927a5d80 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

docs: Update upgrade notes to v0.15

Add section about converting existing networks to floating IP pools.
Also, add tool for converting public IPv4 addresses to floating IPs.
parent e4b5d4e9
......@@ -46,9 +46,11 @@ The upgrade to v0.15 consists in the following steps:
2. Upgrade packages, migrate the databases and configure settings.
3. Register services and resources.
3. Create floating IP pools
4. Bring up all services.
4. Register services and resources.
5. Bring up all services.
.. warning::
......@@ -158,10 +160,45 @@ setting will have the value of
For Pithos service we have to change the ``20-snf-pithos-app-settings.conf``
file in the same way as above.
3. Register services and resources
3. Create floating IP pools
===========================
Synnefo v0.15 introduces floating IPs, which are public IPv4 addresses that can
dynamically be added/removed to/from VMs and are quotable via the
'cyclades.floating_ip' resource. Connecting a VM to a public network is only
allowed if the user has firstly created a floating IP from this network.
Floating IPs are created from networks that are marked as Floating IP pools.
Creation of floating IP pools is done with the `snf-manage network-create`
command using the `--floating-ip-pool` option.
Existing networks can be converted to floating IPs using `network-modify`
command:
.. code-block:: console
snf-manage network-modify --floating-ip-pool=True <network_ID>
Already allocated public IPv4 addresses are not automatically converted to
floating IPs. Existing VMs can keep their IPv4 addresses which will be
automatically be released when these VMs will be destroyed. In order to
convert existing public IPs to floating IPs run the following command:
.. code-block:: console
cyclades.host$ /usr/lib/synnefo/tools/update_to_floating_ips
or for just one network:
.. code-block:: console
cyclades.host$ /usr/lib/synnefo/tools/update_to_floating_ips --network-id=<network_ID>
4. Register services and resources
==================================
3.1 Re-register service and resource definitions
4.1 Re-register service and resource definitions
------------------------------------------------
You will need to register again all Synnefo components, updating the
......@@ -186,7 +223,7 @@ new resources ``cyclades.total_cpu`` and ``cyclades.total_ram`` are
introduced. We now also control the usage of floating IPs through resource
``cyclades.floating_ip``.
3.2 Tweek resource settings
4.2 Tweek resource settings
---------------------------
New resources (``cyclades.total_cpu``, ``cyclades.total_ram``, and
......@@ -222,7 +259,7 @@ change this behavior with::
astakos-host$ snf-manage resource-modify <resource> --api-visible=True (or --ui-visible=True)
3.3 Update the Quotaholder
4.3 Update the Quotaholder
--------------------------
To update quota for all new or modified Cyclades resources, bring up Astakos::
......@@ -233,7 +270,8 @@ and run on the Cyclades node::
cyclades-host$ snf-manage reconcile-resources-cyclades --fix --force
4. Bring all services up
5. Bring all services up
========================
After the upgrade is finished, we bring up all services:
......
#!/usr/bin/env python
"""Tool to convert public IPv4 addresses to floatign IPs, which may be needed
for update to Synnefo v0.15.
"""
import sys
import logging
from optparse import OptionParser, TitledHelpFormatter
# Configure Django env
from synnefo import settings
from django.core.management import setup_environ
setup_environ(settings)
from synnefo.management.common import get_network
from synnefo.db.models import IPAddress
from django.db import transaction
logger = logging.getLogger("update_floating_ips")
handler = logging.StreamHandler()
formatter = logging.Formatter("[%(levelname)s] %(message)s")
handler.setFormatter(formatter)
logger.setLevel(logging.INFO)
logger.addHandler(handler)
logger.propagate = False
DESCRIPTION = """Tool to convert public IPv4 addresses to floating IPs."""
@transaction.commit_on_success
def main():
parser = OptionParser(description=DESCRIPTION,
formatter=TitledHelpFormatter())
parser.add_option("--network-id", dest="network_id", default=None,
help="Update addresses only of this network."),
parser.add_option("--dry-run", dest="dry_run", default=False,
action="store_true",
help="Dry-run mode.")
parser.add_option("-d", "--debug", dest="debug", default=False,
action="store_true",
help="Display debug information.")
options, args = parser.parse_args()
if options.debug:
logger.setLevel(logging.DEBUG)
public_ips = IPAddress.objects.filter(network__public=True,
floating_ip=False)
if options.network_id is not None:
network = get_network(options.network_id)
logger.debug("Converting IPs only of network %s" % network.id)
public_ips = public_ips.filter(network=network)
logger.info("Converting %d public IPv4 addresses to floating IPs.",
public_ips.count())
if not public_ips:
logger.info("No public IPs to convert.")
return
if options.debug:
addresses = public_ips.values_list("address", flat=True)
logger.debug("Converting the following public IPs:\n%s",
"\n".join(addresses))
if not options.dry_run:
public_ips.update(floating_ip=True)
logger.info("Successfully updated public addresses to floating IPs.")
return
if __name__ == "__main__":
main()
sys.exit(0)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment