The same IBM Power servers that run your business on premises are available in IBM Power Virtual Server workspaces in the IBM Cloud platform. Use these on-demand resources to explore new possibilities, enable development and test environments, or extend your production environment. Consumption based pricing means you pay for only what you use and cloud elasticity allows for the expansion and contraction of your cloud footprint based on your business needs.
This blog introduces virtual private cloud (VPC) virtual private network (VPN) to connect IBM Cloud to on premises and then walks through the steps of creating a Power Virtual Server workspace and connecting it to the VPN through a transit gateway.
The architecture is captured in Figure 1.
The numbers in Figure 1 depict the steps in the architecture.
- Create a transit VPC and VPN.
- Create a Power Virtual Server environment.
- Create a transit gateway and connect to both the transit VPC and Power Virtual Server workspace.
- Create a VPC address prefix in transit VPC.
Before proceeding with these steps, as a prerequisite, you need to carefully define the non-overlapping Classless Inter-Domain Routing (CIDR) blocks.
Plan the non-overlapping CIDRs
Find more information, refer to Power Systems communication through a transit VPC in IBM Cloud Docs. A primary concern is to carefully define the non-overlapping CIDR blocks as shown in Figure 2.
1. Create a transit VPC and VPN
The solution tutorial Power Systems communication through a transit VPC captures a number of concerns that may be of interest to Power Virtual Server users in IBM Cloud. This blog focuses on just the bidirectional connectivity between on-prem instances and Power Virtual Server instances through a VPN for VPC connection.
This blog simulates the on-prem environment with a VPC that is connected to a second transit VPC using a VPN gateway connection. It takes only a few minutes to set up using the scripts provided in the companion repository.
Complete the following prerequisites:
- Install Terraform
- Obtain an IBM Cloud identity and access management (IAM) API key
Perform the following steps to create a transit VPC and VPN:
- Export your API key for Terraform usage:
export IBMCLOUD_API_KEY=YourAPIKEY
- Clone the repo and initialize the teraform.tfvars file from the file that contains a template specifically used for the purpose of this blog (template.blog.powervs.terraform.tfvars). It contains the configuration to connect the enterprise VPC to the transit VPC using VPN:
git clone https://github.com/IBM-Cloud/vpc-transit
cd vpc-transit
cp config_tf/template.blog_powervs.terraform.tfvars config_tf/terraform.tfvars
- Make the required changes to terraform.tfvars as explained in the comments. The example considered in this blog requires a data center that supports Power Edge Router in a region that supports VPC as defined in the table in Creating a Power Virtual Server. As per the information in the table, consider Dallas (us-south) with VPC zone us-south-1 and Power Virtual Server data center Dallas 10 (DAL10). To use a different region, zone, and data center make the associated changes as defined in the table.
edit config_tf/terraform.tfvars
- Apply just a few of the initial layers to create only the enterprise VPC, transit VPC, some test virtual server instances, and the VPN connection between the enterprise and the transit VPC. Note the : in the first command, it is not a typo.
export IBMCLOUD_API_KEY=YourAPIKEY
./apply.sh : test_instances_tf
./apply.sh enterprise_link_tf
- On the Virtual server instances for VPC page in IBM Cloud documentation, note the Enterprise Floating IP addresses which is referred as $EFIP later in the tutorial. You can see entries as shown in the following screen capture but your IP addresses might be different.
EFIP=169.62.21.234
It will be handy to keep the value in a temporary file to copy to the shell in later steps.
2. Create a Power Virtual Server environment
In this step, a Power Virtual Server workspace, Secure Shell (SSH) key, subnet, and an instance will be created.
- Follow the initial instructions as mentioned in Creating a Power Virtual Server workspace. The steps are:
- Log in to the IBM catalog with your credentials.
- In the Search the catalog field, enter Power Virtual Server and click the Workspace for Power Virtual Server tile.
- Click Create a workspace.
- In the Location section, from the Data Center list, select a Power Edge Router data center in the same region as the VPC as described earlier (for example, Dallas 10) and click Continue.
- In the Details section, enter blog in the Name field.
- Select the same resource group configured in terraform.tfvars earlier.
- Retain the default values for the other parameters and click Continue.
- Click Finish.
- Select the I agree to the Terms and conditions checkbox.
- Click Create.
- Click the Refresh button and wait for the workspace to display the status as Active.
- On the left navigation panel, from the Workspaces list, select the workspace you just created.
- Click SSH keys on the left navigation panel and perform the following steps to create a new SSH key.
- On the SSH keys page, click Create SSH key.
- In the New SSH key dialog, enter tmp into the Key name field.
- Copy the contents of the config_tf/id_rsa.pub file to the Public key text box. This file was created by the apply.sh script.
- Click Add SSH key.
- Perform the following steps to add a private subnet:
- Expand Networking and then select Subnets in the left navigation panel.
- On the Subnets page, click Create subnet.
- On the New subnet page, enter private in the Name field.
- Enter 10.1.0.0/24 in the CIDR field for zone 1 (as defined in the Plan the non-overlapping CIDRs section).
- Note that the remaining fields are filled in automatically for you.
- Click Create subnet. The new subnet that you just created is added to the Subnets page.
- In the left navigation panel expand Compute and select Virtualserverinstances and perform the following steps to create a new virtual server instance.
- On the Virtual server instances page, click Create instance.
- In the General section:
- Type powerprivate as the instance name.
- From the SSH key list, select the tmp SSH key created earlier.
- Retain the default values for the remaining fields.
- Click Continue.
- In the Boot image section:
- From the Operating system list, select AIX.
- From the Image list, select 7200-05-06.
- Retain the default values for the remaining fields.
- Click Continue.
- In the Profile section:
- From the Machine type list, select the required item.
- Retain the default values for the remaining fields.
- Click Continue.
- In the Storage Volumes section:
- Retain the default values.
- Click Continue.
- In the Network interfaces section:
- Ensure that Public networks is set to Off.
- In Private networks, click Attach.
- In the Attach an existing network dialog, from the Existing networks list, select private that was just created.
- Retain the default values for the remaining fields and click Attach.
- Click Finish.
- Select the I agree to the Terms and conditions checkbox.
- Click Create.
- On the Virtual server instances page, click the Refresh button and wait for the instance to display the status as Active.
Make a note of the IP address for the virtual server instance just created. It is the IP on the private subnet and will be referred to as $PPIP (Power Private IP) later in this blog. Your IP might look similar to the following IP but might be different.
PPIP=10.1.0.246
3. Create a transit gateway and connect to both the transit VPC and the Power Virtual Server workspace
Open the Transit Gateway page and perform the following steps.
- Click Create transit gateway.
- In the Transit gateway name field, enter powertransit.
- From the Resource group list, select the one used for the resources earlier.
- In the Location section, select the Local routing tile.
- From the Location list, select a location to match the VPC, for example, Dallas.
- In the Connections section, for Connection 1, select VPC from the Network connection list.
- From the Region list, select an option (for example, Dallas).
- From the Select VPC list, select Transit.
- Leave Prefix filtering unchanged.
- Click Add connection.
- Click Power Systems Virtual Server.
- Click Location and specify the location of the Power Virtual Server created earlier, for example, Dallas 10.
- From the Available connections list, select the Power Systems Virtual Server workspace, blog.
- Click Create.
To see the list or routes for the transit gateway:
- Select the Routes tab on the top of the page.
- Click Generate report.
The report shows:
- 10.1.0.0/24 - connection to the transit VPC.
- 10.1.15.0/24 - connection to the Power Virtual Server workspace.
But the 192.168.0.0/24 route to the on-premises enterprise is missing! This means that transit gateway will not route traffic destined to an enterprise instance, such as 192.168.0.4, from the Power Virtual Server connection to the transit VPC.
We can see how to fix this in the next section.
Create a VPC address prefix in transit VPC
The transit gateway needs to learn the CIDR blocks on each of the connections. It will learn VPC CIDR blocks from VPC Address prefixes.
Open the Virtual private clouds page and perform the following steps:
- Click the transit VPC name.
- In the Address prefixes section notice 10.1.15.0/24.
- Click Manage address prefixes.
- In the Address prefix table, click Create.
- Enter 192.168.0.0/24 in the IP range field.
- Specify the REGION-1I zone for example Dallas-1 in the Location list.
- Click Create.
Verify that the transit gateway has learned the route by generating a new route report as described in the previous section.
Test
It is now possible to use SSH to connect to the enterprise test virtual server instance and verify connectivity. Make sure that the current working directory is the directory created with the git command earlier, and where the ./apply command was executed. Use the EFIP and PPIP values defined earlier in the blog.
.../vpc-transit % EFIP=a
.../vpc-transit % PPIP=b
.../vpc-transit % ssh -i config_tf/id_rsa root@$EFIP
...
*** System restart required ***
Last login: Tue Mar 5 14:25:23 2024 from 50.53.29.176
root@abc-enterprise-z1-worker:~#
You can ping the Power Virtual Server instance:
root@abc-enterprise-z1-worker:~# PPIP=b
root@abc-enterprise-z1-worker:~# ping $PPIP
PING 10.1.0.217 (10.1.0.217) 56(84) bytes of data.
64 bytes from 10.1.0.217: icmp_seq=1 ttl=22 time=3.37 ms
64 bytes from 10.1.0.217: icmp_seq=2 ttl=22 time=1.46 ms
Exit the enterprise test instance by pressing Ctrl+C and return to the shell on your personal workstation.
You can use the ssh
command to jump through the enterprise directly to the Power Virtual Server instance. This command is a slightly complicated:
ssh -oProxyCommand="ssh -W %h:%p -i config_tf/id_rsa root@$EFIP" -i config_tf/id_rsa root@$PPIP
Clean up
Perform the following steps to delete the transit gateway:
- Open the Transit gateways page.
- Click the name of the transit gateway.
- On each of the connections in the table, click the ellipses menu in the instance row of the table and select Delete.
- From the Actions list in the upper-right side, select Delete.
Perform the following steps to delete the Power Virtual Server resources:
- Open the workspace.
- Click Virtual server instances on the left navigation pane.
- Click the ellipses menu in the instance row of the table and click Delete.
- On the left navigation pane, click Networking->Subnets.
- Click the ellipses menu in the instance row of the table and click Delete.
- Click Workspaces in the left navigation pane.
- Click the ellipses menu in the instance row of the table and click Delete.
Delete the VPN and the simulated enterprise from the working directory.
./apply.sh -d enterprise_link_tf
./apply.sh -d : test_instances_tf
Conclusion
Businesses looking to expand their IBM Power virtual footprint using the latest technology can start today. Use the cloud platform for testing, disaster recovery, and production. Create and delete servers as needed and only pay for what you use.
Read the Power Systems communication through a transit VPC and learn how to connect using the high performance networking of IBM Cloud with the privacy and security that meet your requirements. It also covers connectivity to fully managed services such as IBM Cloud Databases and Cloud Object Storage.