Overview
You can use this document to learn how to create, manage, and delete virtual machine images.
A virtual machine image is a permanent disk image of a virtual machine's disk.
Image management allows you to version images, which is useful to revert unwanted changes and maintain backwards compatibility. For example, if a new image update crashes or degrades performance on your application, you can revert to the previous versioned image and prevent additional downtime.
You can create a virtual machine image to increase scalability and make deployments easier.
View supported image types
To view a current list of supported images:
- In the StackPath Control Portal, in the left-side navigation, click Edge Compute.
- In the left-side navigation, click Images.
- Under StackPath Images, review the list of images.
- Under Description, images with a warning / caution icon indicate a deprecation and obsoletion date. To view the specific dates, click on the icon.
Create an image
When you create an image, the image will be a capture of the root volume of the virtual machine-based workload.
When you create an image from a virtual machine-based workload, the machine will temporarily power off while the image is uploaded. During this process, the image will be labeled as in process.
- In the StackPath Control Portal, in the left-side navigation menu, click Edge Compute.
- Click Images
- Click Create Image.
- If you are on the Images screen, click Custom Images, and then click Create Image.
- In Family, enter a name that will describe the images of the same group.
- You can enter lower-case letters, numbers, and dashes ( - ) to create a valid DNS label.
- As a suggestion, you can enter:
- The operating system type and version number, such as centos-7 or debian-10-buster.
- The primary application, such as postgres-12.
- The primary purpose, such as jenkins-ci.
- In Tag, enter a unique identifier for the particular image within the family.
- You can enter lower-case letters, upper-case letters, numbers, underscores, periods, and dashes to create a valid ASCII tag.
- A tag name cannot begin with a period or dash and cannot be longer than 128 characters.
- As a suggestion, you can enter the specific build number of build date.
- In Source Workload, select the desired workload.
- In Source Instance, select the desired virtual machine.
- In Description, enter a brief description of the image. This description will appear in the Custom Images section.
- Click Save Changes.
- The corresponding virtual machine-based workload will power off while the image is captured from the disk and then stored.
- You will be redirected to the Custom Images screen.
- The newly created image will be in a Pending status, followed by a Ready status.
Deploy an image
You can use these instructions to create a new virtual machine-based workload, based on an existing image.
- In the StackPath Control Portal, in the left-side navigation menu, click Edge Compute.
- Under Custom Images, copy the Reference ID for the desired image.
- Click Create Workload.
- In Name, enter a descriptive name for the virtual machine-based workload.
- In Workload Type, select VM.
- In OS Image, paste the Reference ID you copied earlier, and then select OS image that appears.
- Click Continue to Settings.
- (Optional) If you want your virtual machines to be assigned internal and external IP addresses that allow direct access to each virtual machine, then mark Add Anycast IP Address.
- In other words, this option allows multiple virtual machines to share the same IP address. The location of the user request will determine which virtual machine the user is routed to.
- In Public Ports, specify the ports to allow traffic through TCP or UDP.
- By default, all traffic to the workload is denied.
- In
- Click Continue to Spec.
- In Spec, select the virtual machine type to deploy to the workload.
- Every instance has a root SSD.
- Available types and pricing are listed on the StackPath website.
- (Optional) Under Persistent Storage, configure your storage needs.
- Under Deployment Target, under Name, enter a name to describe the location.
- Under PoPs, select a location to deploy the workload.
- Under Instances Per PoP, enter the number of instances to deploy per PoP.
- For example, if you selected Dallas and London, and you enter 2, then a total of 4 instances will be deployed, 2 in Dallas and 2 in London.
- Failed instances will automatically restart to ensure this number is always maintained.
- (Optional) If you want to enable autoscaling, mark Enable Auto Scaling, and then in the menu that appears, enter the minimum and maximum number of instances, based on the percentage set for CPU utilization.
- Autoscaling is horizontal, not vertical. For example, the performance of a system will not increase from 4x8 to 12x64.
- The autoscaling feature will deploy another virtual machine, within the same PoP and OS template. Your apps will not be installed. As a result, you should still use auto-deploy tools, such as Puppet or Ansible, to make sure the new virtual machine is set up the same as the existing virtual machine.
- Review the pricing information, and then click Create Workload.
Update the permissions of an image
By default, images have permission to be accessed on any virtual machine on the image's stack. In other words, accounts that do not have permission to your portal will not be able to view or deploy a virtual machine with the image.
Additional sharing options are available via IAM permissions. To learn about these options, please contact Support.
Deprecate, delete, or obsolete an image
You can deprecate, delete, or obsolete an image either immediately or schedule a date to make the change. This action can be useful to maintain version control of your images.
Before you update your image, consider the following statements:
Deprecate |
|
Delete |
|
Obsolete |
|
- In the StackPath Control Portal, in the left-side navigation menu, click Edge Compute.
- In the left-side navigation menu, click Images.
- Click Custom Images.
- Under Action, click the vertical ellipses for the corresponding image, and then click Edit Image.
- Click Add Deprecation Date, Add Obsoletion Date, or Add Deletion Date.
- Click Select Item, and then select Immediately or On Date, and then enter a date.
- Click Save Changes.
Update an image's description
Since captured images are immutable, you can only update an image's description. All other properties of an image cannot be changed.
If you want to update additional details of an image, then you must create a new image with the desired details.
- In the StackPath Control Portal, in the left-side navigation menu, click Edge Compute.
- In the left-side navigation menu, click Images.
- Click Custom Images.
- Under Action, click the vertical ellipses for the corresponding image, and then click Edit Image.
- Update the description, and then click Save Changes.
Connect to a deployed virtual machine
When your virtual machine deploys, there are two ways to access the virtual machine. You can:
- Connect as a default user
- Add a user, and then connect as the newly added user
Option 1: Connect to a virtual machine as a default user
Based on the operating system image, review the following default user with enabled sudo permissions:
Operating System | Username |
CentOS 7 | centos |
CentOS 7 - cPanel/WHM | centos |
CentOS 8 | centos |
Debian 10 Buster | debian |
Ubuntu 18.04 LTS | ubuntu |
Ubuntu 19.04 | ubuntu |
When you connect via SSH, you will need to use the username listed in the table. Review the following examples:
ssh centos@[instance.ip]
ssh debian@[instance.ip]
ssh ubuntu@[instance.ip]
Option 2: Add users and then connect to a virtual machine
Once your instance has deployed, you can add users to your virtual machine.
With these instructions, you will add a user to your virtual machine who will have the ability to modify permissions and access.
Review the following example to add the user john.
- Use the adduser command:
sudo adduser john
- Set a password:
sudo passwd john
- (Optional) Add the user to the sudo group:
- Debian
-
sudo usermod -a -G sudo john
-
- RedHat
-
sudo usermod -a -G wheel john
-
- Debian
Since password logins are disabled, you will have to add a public SSH key for this user. To enforce user permissions, add the key to the user's profile, not the root user.
Option 1: On the virtual machine:
sudo su - john
And edit the authorized keys file for the new user and append a public rsa key.
~/.ssh/authorized_keys
Option 2: On a remote machine with root VM access:
ssh-copy-id john@vm_ip_address