Bug Reference

CLOUDSTACK-706

Branch

master, 4.1.0

Introduction

Purpose

Currently in CloudStack, only when the first VM is created on a network is a VLAN ID assigned and the network provisioned. Till then, the network is only a DB entry. Also, when the last VM is destroyed, the VLAN ID is released and the network is no longer available.

This feature will allow users to provision a network without having to deploy any VM’s on it. These networks will be termed persistent and can be part of a VPC or a non VPC environment.

Feature Specifications

Changes in the Network life cycle and Network Offering

Network creation

  • While creating a network, the network offering chosen will define if the network is persistent or not 
    • This will depend on if the new flag 'isPersistent' introduced in network offering is turned on or off in the chosen network offering
  • If the user chooses to make the network persistent, then along with network creation (i.e. making a db entry) the network will also be provisioned
    • Provisioning a network is network implementation i.e. allocating resources and VLAN id
  • In the below mentioned scenarios a new network is created. The network that is created should be persistent if the network-offering available for the specified account is persistent, 
    1. When createVlanIpRange API is called such that the account the range is being dedicated to has no network
    2. When assignVirtualMachine API is called such that the account a VM is being moved to has no network 

Network updation

  • An existing network can be made persistent by updating its network offering to an offering that has the IsPersistent flag set to true
    • While setting this property if the network doesn't have any running VM’s then the it will also be provisioned
  • Network offering of a network is updated from a persistent network offering to a non-persistent one
    • If the network has no running VM's, during the next GC run the network will be shutdown

Network deletion

  • No change in behaviour

Destroying a virtual machine

  • When a VM is destroyed and if it is the last one in the network that it belongs to,
    • Currently in CloudStack the network is shutdown i.e. VLAN id and the network elements (e.g. virtual router) associated with the network are released
    • The above behavior will be modified to check if the network is persistent, if it is then the network will continue to be available for use and if not it will be shutdown
      • This will be achieved by modifying the Network Garbage Collector (GC). The Network GC thread periodically checks if a network is marked to be garbage collected and if there are no active nics on the network. If so, it calls for a network shutdown. Hence we will modify the Network GC to also check if the network offering associated with the network is persistent and call for a shutdown only if it is not.

Deploying a Virtual machine

  • No change in behavior
    • While deploying a VM if the network specified doesn't already exist in the system, a network will be created. If this network is persistent or not will again be determined by the network offering used

Network Offering creation

  • While creating a Network Offering the admin can use the isPersistent flag to set the persistent behavior of the networks created using this offering
    • All default Network Offerings will have the 'isPersistent' flag set to false
    • If the guest type of the network offering is shared, the persistent flag of the network offering cannot be enabled.

Network offering updation

  • No change in behavior
    • 'isPersistent' flag in Network offering will not be editable as this will effect the behavior of the existing networks that were created using this network offering

Use cases

  • Say a user is providing services using physical hardware. At present in CloudStack, if all the VM’s are destroyed in that network, the services will no longer be available because the network is shutdown. With this feature the user can define the network as persistent and hence even if all the Vm’s in it are destroyed the services will not be discontinued.
  • Users might want to create a VPC with one tier consisting of only physical devices. For example, they might create a VPC for a 3-tier application and deploy VM’s for Web and App tier and use the DB tier to deploy virtual machines. And this could be achieved by defining the DB tier network as persistent.

Architecture and Design description

Web Services APIs

No new API’s

Existing API’s to be modified

  • createNetworkOffering
    • add a new Boolean parameter ‘isPersistent’ that determines if the network created using this offering is persistent or not, by default it is set to false
  • listNetworkOfferings
    • add a new parameter ‘isPersistent'
  • listNetworks
    • add a new parameter ‘isPersistent'

UI flow

  • In 'Add network offering' add a check-box called 'Persistent'
    • Action to perform if the check box is selected – In CreateNetworkOffering API call, set Boolean parameter 'isPersistent' to true
    • If the 'Guest-Type' selected is Shared hide the 'Persistent' check box and in CreateNetworkOffering API call, set Boolean parameter 'isPersistent' to false
  • Under 'Service Offerings - Network Offerings' for every Network Offering display a new field called 'Is Persistent'
    • The value of this property is – the value of the response element isPersistent when ListNetworkOfferings API is called

DB

Add new column is_persistent to table networks_offerings

column

comment

is_persistent

if set to true networks created using the networking offering will be persistent, default is false

Upgrade

In an upgraded setup, all existing network-offerings will have the persistent flag turned off

Open Issues

1. Should we introduce the persistent flag as part of Network Offering instead of the API's?

As per discussions in the cloudstack-dev mailing list we will be introducing the 'persistent' flag as part of the Network Offering

Test cases

TBD

  • No labels