Install CF CLI on Tanzu Application Service (TAS) VMs.
search cancel

Install CF CLI on Tanzu Application Service (TAS) VMs.

book

Article ID: 298182

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

This document exemplifies the process of installing CF CLI on TAS VMs. Please find the complete instructions on the official document here.

Environment

Product Version: 4.0

Resolution

 

  1. List the TAS VMs by running the bosh vms command
    bosh vms
    Example:
    ❯ bosh vms
    Using environment 'x.x.x.x' as client 'ops_manager'
    
    Task 817
    Task 818
    Task 817 done
    
    Task 818 done
    
    Deployment 'cf-643a6d1a338ab159acad'
    
    Instance                                                          
    backup_restore/7871be63-1235-4d96-b349-cde19747c6d8               
    clock_global/6cef26f3-72ff-4986-a554-9a92a99c75c8                 
    cloud_controller/8e872638-0dcd-42e6-b4d3-18f066053c74             
    cloud_controller_worker/4f33acbf-9efd-40ba-82ea-743cf137abbb      
    credhub/9acdc8ae-ff1d-4f7d-ad2c-5159271c6662                      
    diego_brain/16fead12-affb-4834-a1fd-b287f10f6526                  
    diego_cell/27b1335e-85d4-4030-af56-dd610743c1a3                   
    diego_database/00b343bb-5c79-456a-a41d-f40851cb5c96               
    doppler/a2eed3d1-b770-4e83-ab8c-3fd8aa50d79f                      
    doppler/f7407a30-0b48-42f2-bd7c-74a0d4b4dcee                      
    log_cache/48be7c34-4dc1-4440-b4da-75981033ad67                    
    log_cache/65df431a-76be-4613-bfa3-530fe4b36491                    
    log_cache/ad6fbeff-9d9b-4b39-8894-3c615fa8cc70                    
    loggregator_trafficcontroller/34776d3e-efd2-4f02-aa74-b3fa491d45bc
    mysql/3b6ed17c-5ec8-4265-a517-d21149483e17                        
    mysql_monitor/134ae6e5-4cee-41d8-a20b-7370af0d40e6                
    mysql_proxy/0e0f1707-c433-4d14-9f0c-65e1f4d62c26                  
    nats/c73d0a4e-0201-44b6-95d3-21f0ca3fbd9c                         
    nfs_server/2787738a-c6ed-4840-9d5f-e61e4caaced1                   
    router/d445a601-5c83-4251-a408-e38cc3f02c8c                       
    uaa/a3db7351-9591-4048-b20a-f010ce0af4bd                          
    
    21 vms


     
  2. For this example, we will select the clock_global/0 VM. So, run the Bosh SSH command to connect to it. 
    bosh -d cf-643a6d1a338ab159acad ssh router/d445a601-5c83-4251-a408-e38cc3f02c8c
    Once connected, swap to the root user by running:
    sudo -i
  3. Under the instruction "Install the cf CLI using a compressed binary" on the guide, you will find the compressed binary file link to download it. We would look for the "Linux 64-bit binary" link file
    curl -L "https://packages.cloudfoundry.org/stable?release=linux64-binary&version=v8&source=github" | tar -zx
    Example:
    clock_global/6cef26f3-72ff-4986-a554-9a92a99c75c8:~# curl -L "https://packages.cloudfoundry.org/stable?release=linux64-binary&version=v8&source=github" | tar -zx
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
      0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
    100 8623k  100 8623k    0     0  6357k      0  0:00:01  0:00:01 --:--:-- 6357k

     
  4. Once downloaded, we are going to make the CF and CF8 files executable by running the command:
    chmod +x cf*
    Make sure they are executable files (* at the end of the name) after running the command:
    clock_global/6cef26f3-72ff-4986-a554-9a92a99c75c8:~# ll
    total 24192
    drwx------  3 root                 root     4096 Sep 23 16:09 ./
    drwxr-xr-x 18 root                 root     4096 Sep 23 16:09 ../
    -rw-r--r--  1 root                 root     3177 Apr 27 20:48 .bashrc
    lrwxrwxrwx  1 bosh_e7ce37399887486  127        3 Sep 12 19:49 cf -> cf8*
    -rwxr-xr-x  1 bosh_e7ce37399887486  127 24670208 Sep 12 19:49 cf8*

     
  5. The next step would be to determine what the /bin folder for that machine is. We can determine it by running the command:
    which vim
    Example:
    clock_global/6cef26f3-72ff-4986-a554-9a92a99c75c8:~# which vim
    /usr/bin/vim

    *Note: The folder without the /vim folder is the correct one. For clarification, in this specific case, the folder is /usr/bin
  6. Once determined the /bin folder path, we would move the CF and CF8 files to it.
    mv cf* /usr/bin
  7. Confirm that CF CLI is installed by running:
    cf --version

    Example:
    clock_global/6cef26f3-72ff-4986-a554-9a92a99c75c8:~# cf --version
    cf version 8.7.3+efd1d03.2023-09-12
    clock_global/6cef26f3-72ff-4986-a554-9a92a99c75c8:~#