How to get credentials used for accessing EODATA on a cloud VM on CODE-DE

Defining to which EODATA repository you have predefined access

The term “EODATA” in this context, means “access to Earth Observation data repositories on CODE-DE”.

You have access to CODE-DE repository of Earth Observation data.

Warning

Please note that the rest of this article does not apply to accessing the CREODIAS repository or the Copernicus Data Space Ecosystem. To get the relevant credentials, ask Support via a Helpdesk and Support page. Then access CREODIAS repository with s3fs and s3cmd commands:

How to Mount Object Storage Container as a File System in Linux Using s3fs on CODE-DE and

How to download EODATA files using s3cmd on CODE-DE

How to access the CREODIAS repository from a VM?

Obtaining the key pair for manual access to an EODATA repository

Many operating system images available on CODE-DE come with access to the EODATA repository that is configured by default, but there are situations in which you will want to configure such access for yourself. You may have, for instance, uploaded a custom operating system image which does not have a configured access to the EODATA repository. Or, you may want to use a method which is not available by default on the operating system image of your choice.

To configure manual access for EODATA repository which is available from your CODE-DE account on FRA1-1 cloud, you will need to provide the access and secret keys. This article provides methods of obtaining them for

  • default Linux virtual machines

  • virtual machines created using user-provided Linux images

  • default Windows images.

Section What To Do Next at the end of this article lists different methods for accessing the EODATA repository, using those credentials.

What Are We Going To Cover

  • EODATA credentials on FRA1-1 cloud

  • Custom and default Linux VMs - executing curl

  • Using Windows VMs

Prerequisites

No. 1 Account

You need a CODE-DE hosting account with access to the Horizon interface: https://cloud.fra1-1.cloudferro.com/auth/login/?next=/.

No. 2 Virtual machine

You need a virtual machine running on CODE-DE cloud on which you want to access the EODATA repository. Make sure that you add dlr-access-net network to it during its creation.

The following articles can help in creating a virtual machine:

If you want to upload a custom Linux image, see one of these articles:

On custom Linux VMs, you will need software which can get data from the network. In this article, we will use curl (installing it, however, is out of scope of this text). Other software, like wget, might also work, but is also out of scope of this text.

Of course, you need to be able to control your virtual machine. You can use SSH as some of the articles above instructed, and you can also use the web console: How to access the VM from OpenStack console on CODE-DE

EODATA credentials on FRA1-1 cloud

On FRA1-1 cloud every project has its own pair of credentials. The method of obtaining them will depend on the type of the underlying image. The following methods are covered in this section:

  • Checking the contents of the appropriate file on default Ubuntu and CentOS images

  • Using curl to obtain the key pair (this method should work both on images mentioned above and custom Linux images)

Important

IP address 169.254.169.254 is fixed and should not be changed in the examples below.

On unmodified Ubuntu and CentOS virtual machines created using images found by default in your project on CODE-DE cloud, the credentials should have been downloaded automatically, during the first boot. From that moment and onwards, they should always be available from the following file:

/etc/passwd-s3fs

Viewing its contents requires sudo privileges:

sudo cat /etc/passwd-s3fs

You should get a pair of access and secret keys separated by the colon. For instance, if 1234 is your access key and 4321 is your secret key, the output will look like this:

1234:4321

If you can’t see your credentials in that file, use method for custom Linux VMs below to obtain them - it should also work on default Linux virtual machines.

Custom and default Linux VMs - executing curl

To obtain the key pair on custom-image base Linux VM and access the EODATA repository, the image should have access to the dlr-access-net network available in your project and the default project network. You will also need appropriate software:

  • For software used to obtain credentials, see Prerequisite No. 2.

  • There are different methods of accessing EODATA. The software used in your chosen method can also be installed later, after obtaining the credentials.

To get the required key pair, you can use curl in the following way:

curl http://169.254.169.254/openstack/latest/vendor_data2.json

The output should look like this:

{"nova": {"vmconfig": {"brand": "code-de", "repomount": "/code-de", "s3_access_key": "1234", "s3_secret_key": "4321", "nvidia_license_key": ""}}}

In your output, instead of 1234 and 4321, you will get the access and secret key associated with your project.

The value for key nvidia_license_key in the row above is an empty string; in reality, you may get a really long actual value of that key in return but here it is omitted as only relevant if you do have a VM built from an NVidia image.

Using Windows VMs

Method 1: Find the key pair in rclone.conf file

If the Windows VM you are working with was

  • created from one of the default Windows images available at Horizon,

  • has access to your default project network and the dlr-access-net network found in your project and

  • was not modified in any way apart from setting the password for the account Administrator,

it should have obtained the credentials used EODATA repository automatically.

If that is the case, you can find your pair of keys in the following file:

C:\Users\Administrator\.config\rclone\rclone.conf

The contents of this file should be similar to this:

[DIAS]
type = s3
provider = Other
access_key_id = 1234
secret_access_key = 4321
endpoint = eodata.cloudferro.com

Instead of 1234, you will have your access key and instead of 4321, you will have your secret key.

Method 2: Get the key pair using a PowerShell command

If your virtual machine has access to the dlr-access-net network and your default project network, you can use the following PowerShell command to obtain your credentials:

Invoke-WebRequest -URI http://169.254.169.254/openstack/latest/vendor_data2.json -UseBasicParsing

The section of the output called Content should look similar to this:

{"nova": {"vmconfig": {"mountpoints": [{"s3_access_key": "1234", "s3_secret_key":
"4321", "s3_url": “eodata.cloudferro.com", "s3_bucket": “eodata”, ...

In that section of the output you will get your access key instead of 1234 and your secret key instead of 4321.

What To Do Next

Now that you know how to get your credentials, you can use them to access the EODATA repository using different methods on different platforms. The following articles can help: