Technical White Paper Morpheus Deployment Guide on Ubuntu 14.0.4 and VSphere 6/30/2016 Table of Contents Introduction... 2 Solution Overview... 2 Requirements... 2 Installation... 5 Preparing the VMWare environment for Morpheus... 5 Install Ubuntu 14.04 on VM... 9 Installing Morpheus on Ubuntu VM... 14 Basic Morpheus Configuration... 17 Installing a Morpheus License... 18 Creating a Key Pair with PuTTY... 18 Installing a Key Pair in Morpheus... 19 Configuring the Cloud-Init Setting with Key Pair... 20 Creating Infrastructure Groups... 20 Creating Clouds... 22 Summary... 29 1
Introduction Morpheus is a software solution that provides robust management capabilities that pull together resources from the on premise infrastructure into many of the leading cloud providers. The deployment and portability of applications becomes simplistic and businesses can achieve cost containment along with operational agility. Morpheus one click provisioning and self-service capabilities deliver all the tools needed to stay in complete control at all times. This technical whitepaper focuses on deploying the Morpheus Appliance into an existing VMWare environment and bringing together resources pools from Nutanix, Amazon Web Services, and VMWare. Solution Overview For the purpose of this paper two hosts have been deployed with VSphere utilizing VCenter to management the hosts. Each of the hosts contains 24 Cores along with 192 GB of memory. Storage has been provided in the form of local storage and an NFS mount. Nutanix Community Edition is also deployed as along with access to Amazon Web Services over a basic 75 Mbps internet circuit. Requirements In the simplest configuration Morpheus simply needs one Appliance Server. The Appliance Server, by default, contains all the components necessary to managed multiple clouds, orchestrate applications, virtual machines (VM), and containers. To get started some base requirements are recommended: Morpheus License: Required for Provisioning. Operating System: Ubuntu 14.04 (recommended) or CentOS/RHEL greater than 7.0. For the purpose of this whitepaper Ubuntu 14.04 was used. To download a copy of Ubuntu you can simply click on the link below which will to take you to the exact image required. Download Ubuntu Server 14.04.4 LTS http://releases.ubuntu.com/trusty/ubuntu-14.04.4-server-amd64.iso Note: A super user account will need to be created for Ubuntu to install Morpheus but this is done during the installation of Ubuntu if not previously installed. CPU: 2Ghz or greater Recommended The VM created for this whitepaper will leverage 2 sockets providing a total of 2 VCPU s. Memory: 4GiB of RAM (Minimum) 8GiB Recommended Memory resources are consumed when starting the Morpheus appliance but as more VM s become managed and the number of persistent connections, statistics collection another other variables the memory requirements grow. Log retention has the ability to impact memory requirements as well. For the purpose of this paper 8GiB memory was used. 2
Storage: 50GiB storage (Minimum) Local storage will grow over time depending on log retention and other variables but for the purpose of this paper 50GiB is utilized. Networking: 1 Network interface with 1GiB or 10GiB capabilities. Internet Connectivity is also required to downloads packages to the appliance during installation. Domain Name Server (DNS): The Morpheus Appliance should be able to resolve its local hostname. A vanity URL is also used for the Morpheus configuration but you can make this the same as the hostname just used the Fully Qualified Domain Name for it. Point to one or more DNS servers as necessary. Additional Considerations for Firewalls and Highly Secure Environments Morpheus primarily operates via communication with its agent that is installed on all managed vm s or Docker hosts. This is a lightweight agent responsible for aggregating logs and stats and sending them back to the client with minimal network traffic overhead. It also is capable of processing instructions related to provisioning and deployments initiated by the appliance server. Communications: Morpheus Appliance -> Host (Unmanaged to Start) TCP Port 22 (SSH) TCP Port 5985 (WINRM Default HTTP Listener) Morpheus utilizes SSH (Port 22) for Linux and Windows Remote Management (Port 5985) for Windows to initialize a server. This includes sending remote command instructions to install the agent. It is actually possible for Morpheus to operate without agent connectivity but statistics and log information will not be reported. Managed Hosts -> Morpheus Appliance TCP Port 443 The Morpheus Agent makes an outbound SSL (HTTPS/WSS) connection from the host to the Morpheus Appliance. The Morpheus Agent exists for both Linux and Windows based platforms and does not open any additional ports on the host. 3
Figure 1: SSH Tools: An SSH key generation tool for creating an OpenSSH Pubic Key will be required. This paper will highlight the use of Putty as well as PuttyGen to create Public and Private keys for use in Key Pair to connect to various hosts. Download Putty https://the.earth.li/~sgtatham/putty/latest/x86/putty.exe Download PuTTYgen https://the.earth.li/~sgtatham/putty/latest/x86/puttygen.exe To create a key pair on Linux please have a look at the following: https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2 4
Installation To get started Ubuntu 14.04 should be downloaded and a Morpheus License should be handy as provisioning on Morpheus is what really makes business operations seamless. Preparing the VMWare environment for Morpheus 1. Login to the VSphere Web Client or VSphere Client to get started. For the purposes of this paper the VSphere Client was used. Note: The login account should have enough permissions to create a VM. 2. Click on Host 192.168.1.15 and select the configuration tab. Navigate to the storage tab so that a list of datastores is displayed. The NFS-Mount datastore was selected in this case as it is the shared storage going between the VSphere hosts. 3. Right-Click the NFS-Mount datastore and select browse datastore. Select the upload files to this datastore button and click upload file. Navigate to the Ubuntu 14.04 iso that was 5
downloaded and click ok. The below figure will show the end result of an Ubuntu 14.04 iso being copied into the iso folder. This iso will be used in future steps to build the Morpheus appliance VM. 6
4. Right-Click the cluster resource in the hosts windows and select create new virtual machine. The characteristics for the virtual machine captured in Figure 5. Click finish to begin the creation of the VM that will be used for Ubuntu and the Morpheus Appliance. 7
5. Edit the properties of the Morpheus-Appliance VM by right clicking it and selecting edit settings. The Ubuntu 14.04 image that was uploaded to the NFS-Mount datastore will not be used to boot the VM. Make sure to check the box to connect at power on. Click ok and power on the VM. 8
Install Ubuntu 14.04 on VM The VM that was created in the previous section should now be booting up and showing the first installer screen of Ubuntu. 1. Selection the appropriate language for the installer and hit enter. 2. On the next screen select Install Ubuntu Server and hit enter. 3. Select the correct language for Ubuntu and hit enter. 4. Select the location and hit enter. 5. For the keyboard configuration select No unless you want to modify keyboard. 6. Select the keyboard origin and hit enter. 7. Select the keyboard layout and hit enter. 9
8. Please enter a hostname on the hostname screen. This hostname will be used by Morpheus during the setup process and after the setup. Create a DNS entry for the hostname on the DNS server that the Ubuntu Linux host will be using to run Morpheus. Select continue and hit enter. Figure 2: 9. Enter a user account that will be created for Ubuntu that will have sudo (super user) privileges by default on setup. 10. Enter a username for the account that to be created. 11. Enter a password then select continue and hit enter. 12. Verify the password then select continue and hit enter. 13. Select No to encrypt your home direction and hit enter. 14. Verify timezone on configure clock screen. If the timezone is correct select yes and hit enter. 10
15. Partition disks using the partitioning method of Guided use enter disk and hit enter. 16. Write the changes to disk by selecting yes and hitting enter. 17. Enter the HTTP Proxy Information as necessary of leave it blank if no SSH proxy server is required. Select continue and hit enter. 18. Select no automatic updates on managing software for the system. Select continue and hit enter. 19. Install the OpenSSH Server on the software to install screen. The OpenSSH server will allow me to connect to the Ubuntu VM via SSH from Putty. Select the OpenSSH server and enter. 20. Install the grub boot loader to the master boot record and select yes. 21. Select continue to finish the installation. The VM will reboot immediately. 11
22. Proceed to login to the VM with the username and password created during the installation process. 23. A DNS entry should have been created if step 8 of this section but if not add an entry to the DNS server. In the case of this document morphapp2.homelab.local was used with an ip address of 192.168.1.188. 24. For the purpose of this document a static IP was assigned to the Ubuntu VM. The Ubuntu VM does not need to have a static IP but most environments used static IP s. To assign a static ip use the following command: sudo vi /etc/network/interfaces 12
Make the necessary changes and save the file. The changes do not take effect until the system is reboot or the interface is restarted. Since we have a few steps we will wait to reboot it all in the end. 25. Next we will want to modify the local hosts file. For this paper a vanity URL was used for Morpheus which will be discussed in the next section but name resolution is key for all of it. To modify the hosts file, issue the following command: sudo vi /etc/hosts Make the necessary changes and save the file. 26. To install VM tools on the Ubuntu issue the following command: sudo apt-get install open-vm-tools 27. To prepare for the Morpheus appliance install getting the latest updates for Ubuntu is key. Issue the following command to pull the latest updates: sudo apt-get update 28. After the updates complete restart, the Ubuntu VM with the following command: sudo reboot 13
Installing Morpheus on Ubuntu VM The Ubuntu VM is now ready to have the Morpheus appliance installed. In this section the Morpheus appliance installation and basic settings will be covered. 1. Login to the Ubuntu VM with the login to with the username and password created during the previous steps. Verify the configuration of the interface and insure that the ip address is set correctly. Issue the following command for verification: sudo ifconfig eth0 more 2. From the Ubuntu VM prompt use the wget command to directly download the package to your appliance server. Issue the following command to initiate the direct download: sudo wget https://downloads.gomorpheus.com/path/to/package.deb Note: Replace package.deb with the actual file name that was provided with the license key This paper uses Morpheus version 2.7.5. 3. Now that the package is download it is time to install Morpheus. To begin the installation, issue the following command: sudo dpkg -I package.deb 4. The installation should complete and return the following message below. Notice the blue arrow pointing to https://morphapp2. Let s update this configuration to point to https://morphapp2.homelab.local for scalable DNS resolution. Issue the following command to change the Morpheus.rb file. 14
sudo vi /etc/morpheus/morpheus.rb Save the edit to the Morpheus.rb file and exit. 5. Now we will configure Morpheus to use this URL. Issue the following commands in sequence: sudo Morpheus-ctl reconfigure Note: This command will take number of minutes to complete. Above is the end result of the Morpheus reconfigured command. sudo morpheus-ctl stop morpheus-ui sudo morpheus-ctl start morpheus-ui 15
6. Now we will wait for the Morpheus User Interface (UI) to respond. However, if you like to check logs and verify and easy way to do this is to issue the following command: sudo tail -v /var/log/morpheus/morpheus-ui/current The goal is to see the cool Morpheus logo that tells us the Morpheus services will respond when we put them in an url. Below is final result: 16
Basic Morpheus Configuration The Morpheus UI is online and responding so now it is time to complete the base configuration of Morpheus. In this section we will cover off the basics of creating groups, Clouds (AWS, VMWARE, Nutanix), and establishing the basics of key pairs and Cloud-Init settings. 1. Morpheus will need a Master Account to get started. This will be and account that provides access to the Morpheus UI. Additional accounts can be created as needed. Fill in the basics as outlined below. Click next after confirming the password. 2. Define an appliance name for Morpheus which might be used for multiple appliances to support something like High Availability (HA). Click on the enable backups to turn on backups on. Then click complete setup. 17
Note: If backups are disabled, they are still created upon instance provisioning and can be executed manually. However, backups will not be executed on a schedule automatically. Scheduled backups must be enabled by an administrator to run automatically. Installing a Morpheus License The Morpheus license will be need for this step as we want to enable provisioning. Copy the Morpheus license that was received in email and paste in the license section. When complete click update. Creating a Key Pair with PuTTY A very important step in Morpheus is creating Key Pairs. Key Pairs are used to connect to instances and VM s that are in most public or private clouds. Click on the PuttyGen.exe file that was downloaded from the requirements section. Click the generate button to start the creation of a key pair. To create the key pair, move the mouse button around several times. When complete save the public and private key. The private key will be used by PuTTY to connect to an instance or VM that is created in Morpheus. 18
Installing a Key Pair in Morpheus 1. Copy the OpenSSH key from the Putty screen and hold it in the clipboard for use in the Morpheus Key Pair creation process. Click on infrastructure tab and then click Key Pairs. 2. Click add key pair and provide the name for the key pair. Paste the public key into the public key section and save the changes. The key pair is now available for use with Morpheus. 19
Configuring the Cloud-Init Setting with Key Pair Now we want to make sure that we put this key pair to good use modifying the Cloud-Init settings will be key. The Cloud-Init settings are located under the Admin tab in the provisioning section. Add in a username/password and select the key pair created in the previous step and click save. Creating Infrastructure Groups Creating groups will be key for organizing things in Morpheus. Groups are used to organize elements of Morpheus like clouds, roles, and servers. Groups can also be searched to easily locate and track down Morpheus elements. 20
Three groups will be created for the following: AWS, Nutanix, and VMWare 1. To create a group, click on Infrastructure and navigate to groups. Click create group and provide and name and location for the group. For the first group use VMWare-Resources and the name and Chicago as the location. Save changes when complete. Create two more groups with the following attributes: Name: Nutanix-Resources Location: Chicago Name: Amazon-Resources Location: Chicago When complete three groups should be listed like the below: 21
Creating Clouds Clouds can be integrations into connections like Amazon, Google, Software Layer, Nutanix, VMWare, or even something like UCS Manager. Clouds in the world of Morpheus are all view and resources pools that can exist in public or private realms. For the purpose of this paper connections will be established to Amazon, Nutanix, and VMWare. Morpheus supports a wide variety of clouds which are listed directly in the cloud dropdown menu for cloud creation. Creating a VMWare Cloud 1. To create a VMWare cloud simply click on the infrastructure tab and navigate to the clouds icon. Click on clouds and select create cloud. Select VMWare from the list of options under create cloud. Save changes when the completed information is populated. Note: Make sure to check the Inventory Existing Instances or any existing instances will not be populated into Morpheus. 22
Creating a AWS Cloud 1. To create a AWS cloud simply click on the infrastructure tab and navigate to the clouds icon. Click on clouds and select create cloud. Select Amazon from the list of options under create cloud. Save changes when the completed information is populated. Note: Make sure to check the Import Existing Instances or any existing instances in will not be populated into Morpheus. For Amazon the Access Key, and Secret Key will be huge for establishing communications. These keys can be located under the Identity and Access Management setting of AWS. Morpheus will work in a classic EC2 model or VPC model. 23
Creating a Nutanix Cloud 1. To create a Nutanix cloud simply click on the infrastructure tab and navigate to the clouds icon. Click on clouds and select create cloud. Select Nutanix from the list of options under create cloud. Save changes when the completed information is populated. Note: Make sure to check the Inventory Existing Instances or any existing instances will not be populated into Morpheus. 24
Cloud provisioning is now complete and the resources avaiable in each of the clouds should be populated into Morpheus. Adding Morpheus Docker Capacity to A VMWare Cloud One of the easiest things to do in Morpheus is to add capacity for Docker instances in any cloud. For the purpose of this paper Morpheus Docker is deployed across a VMWare resource. 1. To add a Morpheus Docker host to a VMWare environment simply click the CHI-VCenter cloud under infrastructure and clouds and select Add Capacity. Select the VMware Linux Node to create a Morpheus Docker host on VMWare. 25
2. Provide the host with the name md-data17. Click next. 3. Configure the host with the following parameters listed in the settings below. A custom template type was selected from configuration granularity purposes. 26
4. Complete the configuration of the VMWare Linux node by clicking the complete button. Morpheus will not begin to build the node on VMWare using the Morpheus Ubuntu 14.04 image that is copied over when the cloud connection for VMWare is established. 5. When the build process completes the Morpheus docker host will be ready for access. 27
6. To connect to the Morpheus docker instance md-data17 open a PuTTY session to 192.168.1.150. The PuTTY client must use the private key that was established earlier. Scroll back up to session and enter the IP Address 192.168.1.150. Click Open. 7. A security pop-up message will appear asking for acceptance of the SSH key. Simply click yes and enter the username from the Cloud-Init settings and the prompt. The prompt will return with a successful login. Security Message: 28
Successful Login: This concludes the creation and access of a Morpheus docker node on VMWare. It is now possible to start creating application instances on MySQL all running on this cool Morpheus docker node. Summary In summary the whitepaper has laid out the foundation for deploying Morpheus on an existing VMWare deployment and scaling it out to manage a number of different resources across AWS and Nutanix. This paper should serve as a basic deployment guide to get someone familiar with deploying Morpheus. 29