July 15, 2021 By Vidyasagar Machupalli
Dimitri Prosper
4 min read

Learn how to configure and scale isolated workloads in shared and dedicated environments on Virtual Private Cloud.

Following the step-by-step instructions provided in this new solution tutorial, you will provision an IBM Cloud Virtual Private Cloud (VPC) with subnets spanning multiple availability zones (AZs) and virtual server instances (VSIs) that can scale according to your requirements to ensure the high availability of your application. Furthermore, configure load balancers to provide high availability between zones within one region. Configure Virtual Private Endpoints (VPE) for your VPC providing private routes to services on the IBM Cloud.

Isolate workloads by provisioning a dedicated host, attaching an encrypted data volume to a VSI and resizing the VSI after the fact. 

You will provision all of these services and VPC resources using IBM Cloud Schematics, which provides Terraform-as-a-Service capabilities. The Terraform template defines the IBM Cloud resources to be created, updated or deleted.

For the Terraform scripts and modules used in this tutorial, check the Git repo.

Auto scale on VPC 

With Auto Scale for VPC, you can improve performance and costs by dynamically creating virtual server instances (VSIs) to meet the demands of your environment. You set scaling policies that define your desired average utilization for metrics like CPU, memory and network usage. You can create an instance group in your IBM Cloud VPC to auto scale according to your requirements by using the IBM Cloud console. Based on the target utilization metrics that you define, the instance group can dynamically add or remove instances to achieve your specified instance availability.

Dedicated hosts on VPC

The reason you create a dedicated host is to carve out a single-tenant compute node — free from users outside of your organization. Within that dedicated space, you can create virtual server instances according to your needs. Additionally, you can create dedicated host groups that contain dedicated hosts for a specific purpose. Because a dedicated host is a single-tenant space, only users within your account that have the required permissions can create instances on the host.

Architecture

  1. The frontend app deployed on VSI(s) communicates to the backend app via the private load balancer.
  2. The backend app securely communicates with the cloud services via a virtual private endpoint (VPE).
  3. As the load on the application increases, scaling for VPC is enabled and dynamically adds or removes VSIs based on metrics like CPU, RAM, etc. or through scheduled scaling.
  4. As the scope expands, the dedicated host isolates and performs heavy computation on the data. Resize the instance on the dedicated host by updating the profile based on your requirement.
  5. All instances communicate with IBM Cloud services over the private backbone using a virtual private endpoint (VPE). See the About virtual private endpoint gateways topic for more details.

Application

VPC uses cloud-init technology to configure virtual server instances. The user data field on the new virtual server for VPC page allows users to put in custom configuration options by using cloud-init.

The application that you will be deploying via user-data is a simple balance form app that shows which services or virtual server instance are responding to a submission (request). The frontend instance runs an Nginx server to serve a PHP web application that talks to the backend to store and retrieve data. The backend instance runs a NodeJS and GraphQL API wrapper for IBM Cloud Databases for PostgreSQL and IBM Cloud Object Storage.

Provision using the IBM Cloud Schematics UI

Follow the step-by-step instructions in the solution tutorial to provision the cloud services and VPC resources and deploy the frontend and backend applications using the IBM Cloud Schematics UI.

What’s next?

Explore other VPC scenarios

There are additional scenarios in VPC tutorials

Questions and feedback

If you have feedback, suggestions or questions about this post, please reach out to us on Twitter or LinkedIn @VidyasagarMSC or Dimitri Prosper. Use the Open doc issue on the tutorial to report a problem on its content. If you see any issue with the Terraform scripts, open an issue here. 

Was this article helpful?
YesNo

More from Cloud

The power of embracing distributed hybrid infrastructure

2 min read - Data is the greatest asset to help organizations improve decision-making, fuel growth and boost competitiveness in the marketplace. But today’s organizations face the challenge of managing vast amounts of data across multiple environments. This is why understanding the uniqueness of your IT processes, workloads and applications demands a workload placement strategy based on key factors such as the type of data, necessary compute capacity and performance needed and meeting your regulatory security and compliance requirements. While hybrid cloud has become…

Serverless vs. microservices: Which architecture is best for your business?

7 min read - When enterprises need to build an application, one of the most important decisions their leaders must make is what kind of software development to use. While there are many software architectures to choose from, serverless and microservices architectures are increasingly popular due to their scalability, flexibility and performance. Also, with spending on cloud services expected to double in the next four years, both serverless and microservices instances should grow rapidly since they are widely used in cloud computing environments. While…

Seamless cloud migration and modernization: overcoming common challenges with generative AI assets and innovative commercial models

3 min read - As organizations continue to adopt cloud-based services, it’s more pressing to migrate and modernize infrastructure, applications and data to the cloud to stay competitive. Traditional migration and modernization approach often involve manual processes, leading to increased costs, delayed time-to-value and increased risk. Cloud migration and modernization can be complex and time-consuming processes that come with unique challenges; meanwhile there are many benefits to gen AI assets and assistants and innovative commercial models. Cloud Migration and Modernization Factory from IBM Consulting®…

IBM Newsletters

Get our newsletters and topic updates that deliver the latest thought leadership and insights on emerging trends.
Subscribe now More newsletters