Deploy a VM using the MobiledgeX Edge-Cloud Console

Version: 1.2
Last Modified: 3/2/2021

In this tutorial, you will learn how to:

  • Download a sample Virtual Machine (VM) image file
  • Upload a VM image to the MobiledgeX Artifactory Registry
  • Deploy the VM (application) to a cloudlet using the MobiledgeX Edge-Cloud Console

Prerequisites

  • A MobiledgeX account where you know your organization name.
  • A sample VM image in QCOW2 format. Instructions to download a sample image are provided below.

Step 1: Download a sample VM image file

  1. Create a temporary folder on your local system.
  2. Download this image from Centos : https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2
  3. As an alternative, you can use wget or cURL to download the image: curl -O https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2.

Step 2: Modify VM SSH Port (optional)

If you are interested in being able to SSH into your virtual machine, you will need to modify the sshd_config port for your CentOS image.

  1. Open the VM in a Virtual Machine emulator like Virtual Box or qemu-system-x86_64
  2. Once that image is running, open the file /etc/ssh/sshd_config
  3. Check if a port has been specified. If so, change the port to 2222. If not, add Port 2222 to this file.
  4. Shut down the image in order to save the changes.

Note: The default port for ssh is 22; however, port 22 is a reserved port on MobiledgeX. As a result, you need to specify an alternative port to use such as 2222.

Step 3: Upload the VM image file to the MobiledgeX Artifactory

  1. On the command line, type ls CentOS-7-x86_64-GenericCloud.qcow2 to verify that your image is in your working directory.
  2. Upload the image to Artifactory by typing in curl -u <username> -T ./CentOS-7-x86_64-GenericCloud.qcow2 "https://artifactory.mobiledgex.net/artifactory/repo-<orgname>/CentOS-7-x86_64-GenericCloud.qcow2".
  3. Once prompted, type in your user password to proceed.
  4. To observe the upload process of your file, type --progress-bar -o upload.txt.

Curl will upload the image to Artifactory. If the upload was successful, you will receive an output similar to the example below. If it was unsuccessful, you will receive an error message. For example, if you received the error "Bad Credentials", it may be that your username, password, or organization was invalid, in which case, you will need to go back and re-type them in correctly.

Upload Example

$ curl -q -u demo -T ./CentOS-7-x86_64-GenericCloud.qcow2 "https://artifactory.mobiledgex.net/artifactory/repo-demoorg/CentOS-7-x86_64-GenericCloud.qcow2" --progress
Enter host password for user 'demo':
{
  "repo" : "repo-demoorg",
  "path" : "/CentOS-7-x86_64-GenericCloud.qcow2",
  "created" : "2020-04-09T14:23:27.958Z",
  "createdBy" : "demo",
  "downloadUri" : "https://artifactory.mobiledgex.net/artifactory/repo-demoorg/CentOS-7-x86_64-GenericCloud.qcow2",
  "mimeType" : "application/octet-stream",
  "size" : "941359104",
  "checksums" : {
    "sha1" : "0a60d34921a5e922aeacfeece13bd5ccfb024cb3",
    "md5" : "ec8c38b1656ded3e03a6dc0938e201f1",
    "sha256" : "b376afdc0150601f15e53516327d9832216e01a300fecfc302066e36e2ac2b39"
  },
  "originalChecksums" : {
    "sha256" : "b376afdc0150601f15e53516327d9832216e01a300fecfc302066e36e2ac2b39"
  },
  "uri" : "https://artifactory.mobiledgex.net/artifactory/repo-demoorg/CentOS-7-x86_64-GenericCloud.qcow2"
}%  

The proceeding steps require you to have an md5 sum. Note that the md5 is returned as shown in the example above.

Step 4: Create an application definition

You are now ready to create an application. The Apps page lets you define your backend application deploying to our registry. Performing this steps creates an 'inventory' of your applications that are part of the registry and prepares it for deployment.

  1. From the left navigation, click Apps.
  2. Click the + sign to add a new Application definition. The Create Apps page opens.
  3. Select EU for Region.
  4. For App Name, type in a name, such as vmtest.
  5. Enter 1.0 for App Version.
  6. For Deployment Type, select VM.
  7. For Access Type, select Direct.
  8. Select Qcow for Image Type.
  9. For Image Path, enter https://artifactory.mobiledgex.net/artifactory/repo-demoorg/CentOS-7-x86_64-GenericCloud.qcow2#md5:ec8c38b1656ded3e03a6dc0938e201f1, where md5sum is in the format of $md5:sum.
  10. For Default Flavor, select EU>m.small.
  11. For Port, enter 2222, and select TCP.
  12. Type the following into the Deployment Manifest:
#cloud-config
user: demouser
password: NoMoreSecret3
chpasswd: {expire: False}
ssh_pwauth: True  

Note: While optional, if you wish to ssh into your VM, make sure to add your ssh public key to the Auth Key section under Advanced Settings.
13. All other fields, leave blank.

Create Apps screen
Create Apps screen

The console will process your request and return you to the Apps screen where you should see your application.

Step 5: Create an application instance

You are ready to deploy your application. The App Instances page is where you provision your application and deploy it to a cloudlet. This step is called application provisioning. This page displays information such as the current applications running on the platform and their location.

  1. On the left navigation, click App Instances.
  2. For Region, select EU.
  3. For Organization Name, type in a name, such as demoorg.
  4. Type vmtest for App Name.
  5. For App Version, enter 1.0.
  6. For Operator, select TDG.
  7. For Cloudlet, select munich-main.
  8. Click Create. The console will process your request and bring up a progress window. Once you close out of the progress window, you will be returned to the main App Instance page where you should see your new VM Instance.

Step 6: Test your VM

You will need the following:

  • Information pulled from the details page for the App Instance, which can be accessed by clicking on the App Instance row on the App Instance page.
  • FQDN and the Port.
  • SSH into the system with the username and password you set in the cloud init file (manifest). You can also bring up a terminal.

To test that your VM was deployed correctly, navigate to the App Instance page and under the quick access menu, select terminal. You can see your VM running. If the VM is GUI based, such as Windows-based, you can interact with the Windows desktop.