Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
Showing results for 
Search instead for 
Did you mean: 
Active Contributor
Recently Virtual machines were made generally available in SAP HANA Cloud Platform (only in EU  Data center). You can use these virtual machines to install and maintain your own applications which are not otherwise available on HANA Cloud Platform.

Let’s take a close looks at what is provided as part of the virtual machine. Customers get access to virtualized hardware resources which include RAM, CPU, disk space along with SUSE Linux Enterprise Server. These virtual machines run in a private virtualized network and can be integrated with the HCP resources within the same account.They are available in different t-shirt sizes.

T-shirt sizes CPU RAM (GB) Disk (GB)
XS 1 2 20
S 2 4 40
M 4 8 80
L 8 16 160
XL 16 32 320

Once a virtual machines is provisioned to the customer, it’s the customer responsibility to patch the OS and also plan for the backup regularly.

The communication to the virtual machines is allowed only via a SSH tunnel using the console client. Once the tunnel is established, you can SSH and login as a root into the VM. In the above diagram, I have depicted a tighter integration of applications running in the VM with HANA DB or Apps running in the same HCP account.

Also, another important thing to note is that you can enable all outbound communication from Virtual Machine to outside world. However, an inbound call from the outside world has to be HTTPS and it would be directed to a software process running on your VM and listening on port 8041.

Myself and my colleague Former Member began on a journey to install SAP HANA Express on top if these Virtual Machines. We were particularly interested to leverage nodejs and other XSA features which are not currently available in HCP HANA DB. We managed to install HANA Express only to find that we are restricted in accessing the HANA system from outside the VM. We neither could use HANA Studio nor even access XS engine via the browser.  We then focused on installing nodejs runtime on the VM and created an application which uses XSOData service exposed from the HANA DB available in the HCP account. In this blog, we will outline the steps performed to run a nodejs application on the HCP VMs.


Provision a VM for your HCP Account

To get started, you need to request a VM to be provisioned to your HCP account. Once it is provisioned, you can navigate to the Quota Management section of your HCP account to verify the quota. In our example, we have used extra large VM.

Create an instance of your VM

Once the VM is provisioned to your HCP account, you are now ready to create an instance of the VM.  I have put all the softwares – openSSL, HCP SDK, Putty in a folder called VM located in my C drive.

You would need to issue the below Neo command to create an instance of my Virtual Machine. Provide a pass phrase as it will be needed to generate the certificates.
neo create-vm --size x-large --name myhex1 --account a6de11574 --host --user <myuser>

After a minute, you will be able to see a virtual machine created in your account and it should have the status as Started.

You will also find a new key generated in the SDK folder

Use openSSL to create a .pem certificate as shown below.
openssl.exe rsa -in "C:\VM\SDK\tools\\a6de11574\myhana.key" -out myhana.pem

This would generate .pem file within the bin folder of openSSL.

Launch the Putty Generator tool.

Navigate to menu Conversions > Import key and import the .pem file generated in the previous step. Provide the pass phrase and click on “Save Private Key”.

This will generate a .ppk file which we will need always to access the VM.

In order to enable access of this VM from the internet, you would need to provide the below command.

List the VMs associated with your account using the list-vms command. Make a note of the floating IP and the access-point URL
neo list-vms --account a6de11574 --host --user <myuser>

Finally, create an SSH Tunnel by using the open-ssh-tunnel command. This will give you a port which you will need to use when trying to login via SSH client.
neo open-ssh-tunnel --vm-id 75a31590-2f93-4901-9786-9098bcce6e4c --account a6de11574 --host --user <myuser>

Launch Putty and from the left hand side menu, navigate to Connections > SSH > Auth and use the browse option to locate the .ppk file generated earlier.

Navigate back to session and under host name provide root@localhost and port with the value obtained earlier.

Provide the Pass phrase and you will be logged on to the VM.

Build you applications on top of the VM

We now have full access to install any software we wish to. As I mentioned earlier, we installed HANA Express and were able to start/stop the instance. But due to some restrictions, we were not able to connect via HANA Studio. Hence, we installed Nodejs following the standard documentation from nodejs website.

We put up an application which creates a HTTPS server renders a web page. We enhanced this further by making the appliction to query an HANA XSOData service to obtain top sales orders. The XSOData service is based on the standard SHINE contents which have been installed on the HCP HANA DB. This web applications has to be accessed over HTTPS.

Below is the snapshot of the js file. Notice that we have made the server to listen on port 8041. This programs needs to be executed for anyone to access the Webpage externally.

Here is the sample XSOData service from the SHINE contents which are installed on HCP HANA DB

Below is the code snippet to make a call to the XSOData service and obtain the results.
var http = require('https');
var extServerOptions = {
host: '<host>',
port: '443',
path: '/sap/hana/democontent/epm/services/salesOrders.xsodata/SalesOrderHeader?$top=1&$format=json',
method: 'GET',
auth : 'userID:MyPassword'

function get() {
http.request(extServerOptions, function (res) {
res.on('data', function (data) {
salesOrder = JSON.parse(data);



Once the nodejs application is executed, anyone on the internet can access the application using the access point URL

Below is how the web application would look like. Notice that I am accessing it via HTTPS and the application displays Sales Order details which are available in a HCP HANA DB.

I think these Virtual Machines will open more opportunities for customers to would be able to implement more scenarios which they couldn't achieve earlier. Hope you found this useful.
Labels in this area