CloudStack defines many resource classes which abstract the physical or virtual resources that are being managed by the CloudStack. These resource classes can be hypervisors, load balancers, or storage devices.
CloudStack networking flows
The main components of CloudStack networks have been described above; let's see how these network flows occur when we create a new network and when we create a new guest instance in that network. There are several processes that are invoked at various steps during the flow. A brief overview of the steps followed is as follows:
1. When a new network is created, first the network offering from which the network has been created is validated.
2. The account that is creating the new network has the administrative rights for the shared networks.
3. The IP address and the CIDR information provided for the new network is validated by checking the user's CIDR limit and the overlapping of any other CIDR.
4. A new network model object is created with all the properties of CIDR, gateway, broadcast domain type and broadcast URI.
5. Call all the NetworkGurus and the design method is invoked.
The new network created is in virtual state until a guest instance is created in that and when a new VM is created in this new network, the following series of events takes place.
6. The prepare() method is invoked when the VM starts up.
7. The NICs are retrieved for the instance. For each of the network interface, a retrieve data model object is retrieved.
8. Configure the network on the virtual or physical networking resources such as configuring CIDR and Gateway.
9. The list of providers that are included in the network offering is listed and for each of the network elements in the list of providers, the implement() method is invoked on the instance if it is not already implemented in some other network.
11. The reserve() method is invoked on the NetworkGuru to reserve the resources.
12. IP addresses, MAC addresses. Broadcast, netmask, and gateway address is set for the network interfaces.
13. The network elements are asked for the new NIC, using the prepare() method on each of them.
14. The connectivity of the new NIC created is tested and make sure that it is properly connected across all the network elements in the current network offering.
15. The entries of the NIC are added to the DHCP service provider and the User Data service providers.
16. The new NIC is added to the VM profile.
Summary
This chapter covered the networking features available in CloudStack. The chapter also describes the ways in which the CloudStack administrators can use the different components (the interfaces and the classes) to create a network service other than the standard network offering of CloudStack.
We will continue to explore CloudStack and move on to the storage configuration and support in CloudStack in the next chapter.
Apache CloudStack Storage
By now you should be aware that CloudStack has two major categories of storage, that is primary and secondary storage. Primary storage is used for providing disk volumes for guest VMs and is associated with a cluster of the CloudStack deployment. Secondary storage is associated with a zone, common to all the pods in the zone and is used for storing templates, ISOs and the disk volumes' snapshots. We will now discuss the storage aspect of CloudStack, which will include the following:• Architecture of storage in CloudStack
• Creating, modifying, and deleting various types of storage by both users and administrators
• Scaling storage as required
Primary storage in a cluster depends on the hypervisor being used in the zone. Primary storage can vary from NAS to SAN to even DAS depending upon the capabilities and requirements of the hypervisors. Primary storage can be added to CloudStack using direct attached storage, local storage, iSCSI, or NFS. CloudStack 4.0 supports using an RBD storage pool as primary storage, whereas secondary storage is accessed only by using NFS. CloudStack also supports OpenStack object storage (Swift) as secondary storage.
Primary storage is used for providing storage space in the form of volumes to Cloud VMs whereas secondary storage is a file-based storage used to store files such as snapshots, templates, and ISO images. Lets' take a walk through adding and using both types of storages in CloudStack.
Primary storage
Primary storage in CloudStack is common to a cluster and is used to provide disk volumes to the guest VMs. It means all the virtual machines on all the hosts in a cluster are provided with their own root volumes as well as other data volumes from the primary storage associated with that cluster. There can be multiple primary storages added to a cluster with different storage tags and the guest VMs are allocated disk volumes from these primary storages by CloudStack. The storage tags (discussed later) are to be used while provisioning the guest. The storage tag is matched with the tags of the primary storage added to CloudStack.