Apache CloudStack 4.15 Usage Tips
Utilizing Some Features of CloudStack
Adding a Virtual Private Cloud (VPC), Creating an Instance, and Modifying the User Interface
Please see Here for Installing CloudStack.
Creating a Virtual Private Cloud
This is a quick and easy way to setup networking for your instances. Utilizing this, your instances should be able to get out to the internet, as well as connect to other instances on that private network. CloudStack defines a VPC as:
"CloudStack Virtual Private Cloud is a private, isolated part of CloudStack. A VPC can have its own virtual network topology that resembles a traditional physical network. You can launch VMs in the virtual network that can have private addresses in the range of your choice, for example: 10.0.0.0/16. You can define network tiers within your VPC network range, which in turn enables you to group similar kinds of instances based on IP address range
For example, if a VPC has the private range 10.0.0.0/16, its guest networks can have the network ranges 10.0.1.0/24, 10.0.2.0/24, 10.0.3.0/24, and so on" (VPC, 1).
To configure this, go to Network -> VPC -> Add VPC
Give the VPC a name and a description, and tell it what Zone it should be added to. The CIDR is the private network that you want this VPC to have. It should be a common private network range, according to RFC 1918/RFC 1597. Configure it similarly to Figure 18.
Hit OK and continue. Once the VPC is setup, it should be listed in that same section. Click on the name and it will take you to the VPC configuration page. Go to Networks and click Add Network. Configure it similarly to Figure 19. The gateway is the gateway of your local network.
Click OK. In order to create the virtual router needed, you will need to create an instance with that network.
Adding an Instance
Instances can be created in Instances -> Add Instance. Be sure to select your network in the Networks section of instance creation. You can leave the IP address and the MAC address blank if you want CloudStack to automatically configure that for you. Once done, CloudStack will automatically begin creating the instance.
Click on the name of the Instance and then click on the shell icon in the top right. This will launch a connection to the instance within the browser.
Once done, the virtual router will be created and assigned a public IP address. The instance will be assigned a private IP address. So long as you configure your instance correctly, you should have a working networking solution utilizing VPC!
Uploading ISO / Template Creation
This section will show how to upload an ISO and then create a system template utilizing that same ISO within CloudStack. Before beginning, see the Notes section and understand the issue with uploading ISO's locally. For this example, we will be registering a Windows Server 2016 ISO from https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2016.
First, navigate to Images -> ISOs. There, click on + Register ISO. There, you will need to input some requested information. Fill it out similarly to Figure 20.
This should be pretty self-explanatory. The URL is the link to the ISO you want. Bootable lets CloudStack know that this ISO is a bootable disc. OS Type is used to help CloudStack prepare your ISO and makes assumptions to improve performance for the guest. Extractable makes it so that the ISO is available for extraction, Public allows for other users to access the ISO, and Featured will allow for the ISO to be easily selected when creating an instance.
Once done, CloudStack will begin downloading the ISO. This may take a while. Once done, create an instance utilizing that ISO and install your operating system. Configure your operating system how you would like it.
Everything up to this point should be universal for all operating systems. Now however, the process may change. This guide will continue on with creating a Windows template, which involves sysprepping the machine. Be sure to look up if there are any specific requirements for creating a template with your operating system before creating the template. The template creation procedure should be universal and is listed below.
On the VM, install cloud-init from https://cloudbase.it/cloudbase-init/. Just run the tool, selecting sysprep once finished and then shutdown. Once its done shutting down, proceed to the next step.
Stop the virtual machine. Then, go to Volumes. You should see at least one volume, which should be called ROOT. Click on it, then in the top right corner of the volume select Create Template from Volume. Change the settings as you desire, then click OK. Your template will now start to be created.
Figure 20, Register ISO Config
Customizing Basic UI
CloudStack allows for an easy way to modify the basic UI through the use of an editable configuration file. Basic configuration includes modifying the colors of different CloudStack views, the logos, heights and widths of views, and more. This section will describe the process of modifying the CloudStack logo.
First, acquire a logo you would like to use and save it to the /usr/share/cloudstack-management/webapp/assets folder. Next, navigate to /usr/share/cloudstack-management/webapp/config.json. This file should look similar to Figure 20.
At the top, modify the "logo" variable and set it to "assets/<yourlogoname>" along with the file extension. Then, log on to Apache CloudStack, and you should see your new logo in the top left corner. To modify the size of the logo, scroll down in the config.json file and change the @logo-height and @logo-width values. This same process can also be done for the banner on the login page.
This section showed the path to the basic configuration file and how to edit the values to make simple changes to the user interface of CloudStack. Advanced UI customization is possible only by changing JavaScript based config files which define rules for sections, names, icons, actions and components and by building the UI from the source available on github.com/apache/cloudstack repository.
References
[Agent Install] Apache Foundation. "Host KVM Installation --- Apache CloudStack 4.15.0.0 Documentation." Apache CloudStack, Apache Foundation, 2021, https://docs.cloudstack.apache.org/en/latest/installguide/hypervisor/kvm.html
[Management Server Install] Apache Foundation. "Management Server Installation --- Apache CloudStack 4.15.0.0 Documentation." Apache CloudStack, A, 2021, http://docs.cloudstack.apache.org/en/latest/installguide/management-server/index.html
[Quick Installation Guide] "Quick Installation Guide --- Apache CloudStack 4.15.0.0 Documentation." Apache CloudStack, Apache Foundation, 2021, http://docs.cloudstack.apache.org/en/latest/quickinstallationguide/qig.html
[VPC]Apache Software Foundation. "Configuring a Virtual Private Cloud." Apache Docs, 2016, docs.cloudstack.apache.org/projects/archived-cloudstack-http://docs.cloudstack.apache.org/projects/archived-cloudstack-administration/en/latest/networking/virtual_private_cloud_config.html
[Cloudstack Configuration] Apache Software Foundation. "Configuring Your CloudStack Installation --- Apache CloudStack 4.15.0.0 Documentation." Apache Cloudstack, Apache Software Foundation, 2021, http://docs.cloudstack.apache.org/en/latest/installguide/configuration.html#initialize-and-test
Apache Software Foundation. "Log In to the UI." Apache CloudStack Docs, Apache Software Foundation, 2021, https://docs.cloudstack.apache.org/en/latest/adminguide/ui.html
[Mailing List for Questions, Strong Troubleshooting Reference] Apache Software Foundation. "Pony Mail!" Pony Mail, Apache Software Foundation, 2021, https://lists.apache.org/list.html?users@cloudstack.apache.org
[Uploading ISO] "Working With Templates." Apache CloudStack, Apache Software Foundation, 2021, https://docs.cloudstack.apache.org/en/latest/adminguide/templates.html
[Troubleshooting Secondary Storage] Prasanna. "SSVM, Templates, Secondary Storage Troubleshooting." Cwiki Apache, cwiki, 2014, https://cwiki.apache.org/confluence/display/CLOUDSTACK/SSVM,+templates,+Secondary+storage+troubleshooting
[New Total Learners Resource on CloudStack] ShapeBlue. "Shapeblue/Hackerbook." GitHub, Apache Software Foundation, 2021, https://github.com/shapeblue/hackerbook
[Some Ports Used By Cloudstack]Yadav, Rohit. "Ports Used by CloudStack." Cwiki, Apache Foundation, 2013, https://cwiki.apache.org/confluence/display/CLOUDSTACK/Ports+used+by+CloudStack
[CloudStack Configuration] "Rohit Yadav - Apache CloudStack on Ubuntu with X86_64 KVM." Rohit Yadav, Rohit Yadav, 4 July 2019, https://rohityadav.cloud/blog/cloudstack-kvm