Skip to content

If you require assistance or run into issues with the hands-on lab, help is available. Submit questions via email to a dedicated support Slack channel #wca-generative-ai-training, staffed by IBM subject matter experts.

Address your questions to:

p2f5b9t8h2i9i1q4@ibm-technology-sales.slack.com

Questions can be submitted without needing access to Slack or a Slack account - simply email the address above and we will respond to your query within 24 hours.

Configuration of Visual Studio Code

Before getting started with IBM watsonx Code Assistant for Red Hat Ansible Lightspeed (WCA), you will first setup Visual Studio Code (commonly referred to as VS Code) within the lab's virtualized machine (VM). This will provide an integrated development environment for experimenting with WCA's generative AI capabilities.


  1. From the learn.ibm.com course page, navigate to the Lab Environment section and launch the IBM SPVC Labs: W7S174G VM environment.

    • Provisioning typically takes about 90 minutes or less

    • Periodically refresh this page and click the Direct Environment Access[A] button to test if the VM is available

    • When the page displays a Red Hat VM box, the environment is ready for access

    • Click the VM box[B] to launch the hands-on environment


  2. Select the techzone[A] login when prompted.

    • Supply the following for the password:

      IBMDem0s!
      
    • Hit Enter to complete the VM login



  1. Once you have successfully authenticated, click the Activities[A] button in the top-left corner of the interface to pull open the list of available applications from the bottom of the screen.

    • Click the Visual Studio Code[B] application shortcut at the bottom of the desktop to start up the service.

    • If you wish to copy and paste instructions directly from the lab documentation into the virtual machine (VM), it is recommended that you open the GitHub instructions inside the VM's web browser (Firefox). This will allow you to copy instructions to the VM's clipboard and paste instructions inside the VS Code editor.

    • You may access the web browser at any time by clicking the Activities[A] button and then launching Firefox[C], as shown.



  1. VS Code will load and then present you with an Authentication Required splash screen.

    • Enter the same password[A] used to log into the VM:

      IBMDem0s!
      
    • Click Unlock[B]


Accessing your Red Hat credentials and authenticating with WCA

Red Hat credentials were automatically generated for you as a result of launching the Lab Environment VM. You will have received invitation email to your inbox with a header similar to Red Hat Login Email Verification, addressed from a no-reply@redhat.com account.

Locate this email in your inbox and follow along with the steps below to authenticate the VS Code extension with IBM watsonx Code Assistant for Red Hat Ansible Lightspeed (WCA).


  1. Click the URL[A] located within the body of the invitation email to finalize your account registration with the WCA environment.

    • An Email Confirmation page will load within your web browser

    • Record the value of Red Hat login to a notepad for reference later

    • Create a new Password and record this to a notepad for reference later

    • When ready, click Save[B] and return to the VS Code application

    REGISTRATION IS REQUIRED

    • If you already have a personal account with Red Hat, you must still register for a new account using the invitation URL provided

    • Do not attempt to use a personal Red Hat account in the later steps of the Setup & Troubleshooting guide, as that account will not have access to the WCA services needed to perform the training

    • Red Hat accounts created for this training will be de-authorized and deleted after the hands-on training period has ended



  1. Within your VS Code environment click the Ansible plugin[A] (denoted by the A logo) on the left-hand side of the interface.

    • Two panels will open along the left side of the interface

    • Within the Ansible Lightspeed Login panel, click the blue Connect button[B]

    • The extension Ansible wants to sign in using Ansible Lightspeed: click Allow[C]

    • Do you want Code to open the external website?: click Open[D]



  1. A web browser will load with the header Log in to Ansible Lightspeed with IBM watsonx Code Assistant — this is where you will supply your registration details recorded in Step 5 in order to authenticate the VS Code plugin with WCA.

    • Click the Log in with Red Hat button

    • Provide the Username and Password recorded in Step 5 of this module

    • Click Submit to continue

    • When prompted for We need a little more information, set Job Role to Student

    • Click the Submit button to finalize your account activation

    COPY AND PASTE INSTRUCTIONS INTO A VIRTUAL MACHINE

    As you are running the lab environment inside a virtual machine (VM), it is not possible to "paste" lab instructions or information from your local machine's clipboard directly into the VM. Instead, you may use the Send Text feature located in the top-center of the VM interface.

    • Place your cursor within the VM where you wish to paste instructions or text from the clipboard

    • Click the Send Text icon[A] to open a pop-up window.

    • Paste your local machine's clipboard contents into the input field[B]

    • Click the Send Text button[C] to the right of the input field to "paste" the contents into the VM

    • Click the X icon[D] to close the pop-up window

    If you wish to copy and paste instructions directly from the lab documentation, it is recommended that you open the GitHub instructions inside the VM's web browser (Firefox). This will allow you to copy instructions to the VM's clipboard and paste instructions inside the VS Code editor.



  1. After logging in with Red Hat, the web browser will display the prompt to Authorize Ansible Lightspeed for VS Code.

    • Click Authorize[A]

    • Allow this site to open the vscode link with Visual Studio Code - URL Handler?: click Open URL



  1. At this stage, the Ansible extension for VS Code is now authenticated and connected to IBM watsonx Code Assistant.

    • Verify[A] that the environment is logged in as your unique Username and that the User Type: Licensed

    • A notification pop-up will also appear in the bottom-right corner of the VS Code interface confirming the successful login


    CLICK TO EXPAND — FAILURE TO LOGIN OR TIMED OUT
    • If the authentication procedure in Steps 6-8 takes too long, activation of the plugin will be "timed out" and the VS Code environment will display an error message[B] in the bottom-right corner

    • Click the Connect[C] button as shown and repeat Steps 6-8 as before; the login process should run smoother (and faster) on the second attempt



Troubleshooting and support

If you require assistance or run into issues with the hands-on lab, help is available. Submit questions via email to a dedicated support Slack channel #wca-generative-ai-training, staffed by IBM subject matter experts.

Address your questions to:

p2f5b9t8h2i9i1q4@ibm-technology-sales.slack.com

Questions can be submitted without needing access to Slack or a Slack account - simply email the address above and we will respond to your query within 24 hours.

As you settle in to the environment and begin your training, you may encounter unexpected warnings or errors. Many of these can be safely ignored or can be easily rectified. This section will serve as a running list of frequently asked questions and troubleshooting techniques. Click on any of the following topics for additional details.


FAILED TO CONNECT TO THE SERVER / "YOU DON'T HAVE ACCESS TO IBM WATSONX..."

This warning will occur when the Ansible plugin for VS Code needs to be re-authenticated with WCA. It can occur after an extended period of inactivity or a system restart. For example, if your lab environment is running inside a VM, pausing or restarting the VM may produce this error.

To re-authenticate:

  • Sign out from the VS Code application by clicking the User icon[A] in the bottom-left corner of the interface, hover over your username, and then click Sign Out[B]

  • If you are running this environment inside a virtual machine (VM), closing and restarting the VM will not resolve the issue — you must sign out from the VS Code application, not the VM

  • Once logged out, follow from Step 7 of the Setup & Troubleshooting to re-authenticate with WCA


CODE RECOMMENDATIONS ARE NOT GENERATING

Ansible Lightspeed and WCA will only generate code recommendations for Ansible Playbooks and YAML files. VS Code will typically auto-detect the programming language of the document you're working with, but on occassion you may need to manually specify the language. Even if working with a YAML file, you'll still need to specify the language mode as Ansible for the Lightspeed plugin to engage.

To set the language mode correctly:

  • In the bottom-right corner of the VS Code interface, hover over the Select Language Mode toggle[A]

  • A console will appear at the top of VS Code with a drop-down list of options[B]

  • Click Ansible from the suggested languages, or enter the text yourself and hit Enter

  • Confirm that the Select Language Mode toggle in the bottom-right corner displays Ansible


"ANSIBLE-LINT IS NOT AVAILABLE."

ansible-lint checks Playbooks for practices and behavior that could potentially be improved and can fix some of the most common ones for you. It will constantly check your Ansible syntax as you type and provide recommendations for how to improve it.

  • You can safely ignore this error if it occurs during the lab exercises

  • If you wish to install ansible-lint on your local machine, execute the following instruction within a Terminal console:

    python3 -m pip install --upgrade --user ansible-lint
    

RED ANSIBLE ICON ALONG BOTTOM-RIGHT INTERFACE

The Ansible extension for VS Code will check your local machine to determine if Red Hat Ansible has been installed locally. If you have not set up Ansible (the standalone version) on your local machine previously, this tile will display as red.

You can safely ignore this error if it occurs during the lab exercises.


CANNOT SET PROPERTIES OF UNDEFINED (SETTING 'currentModelValue')

Make sure that the Model ID Override field is set to empty in your Ansible for VS Code extension settings.

To verify this:

  • Click the Extensions tab[A] along the left-hand interface

  • Click the Manage icon[B] on the right side of the Ansible extension tile, then drill down into Extension Settings[C]

  • Add the text Model to the search filter[D] at the top of the Extension Settings panel

  • Clear the input field[E] of any model IDs and leave it blank

  • Close the Extension Settings panel by clicking X and return to the Ansible Playbook


SPAWN C:\Windows\system32\cmd.exe ENOENT

This warning is not related to Ansible or WCA. You can safely ignore this error if it occurs during the lab exercises.


PYTHON DRIVERS ARE MISSING

The WCA extension for VS Code requires that Python drivers are included within the workspace. These are usually configured within VS Code by default, but can be easily set if necessary. Look for a Python tile adjacent to the Ansible tile along the bottom-right corner of the VS Code interface. If it is not set, click the tile and select the Python 3.11.5 64-bit drivers.

  • Click the gold-colored Select python environment button at the bottom-right of the interface

  • From the console at the top of the VS Code environment, select the recommended Python 3.11.5 64-bit option and hit Enter to confirm


GIT NOT INSTALLED

If your machine has not used Git previously, you may be prompted by VS Code to install it before attempting a clone request. This is more commonplace on Windows operating systems, but some MacOS users may need to install Git as well. The following instructions will guide you through the process:

  • With the VS Code application open, click the Source Control[A] tab from the left-hand interface and then click Download Git[B].

  • A web browser will open to the git-scm.com Downloads page.

    • Download[C] the version recommended for your machine's particular operating system.

    • The recommended version will be displayed first at the top of the list.

    • Execute the installer on your machine and follow along with the prompts to finish installing Git. Accept the license agreement and accept the default values on each page.

  • Return to VS Code and once again click the Source Control[D] tab, then click the blue Initialize Repository[E] button.

  • From the top of the Source Control tab, click the three dots ...[F] icon to expand a drop-down menu of options. Click on the Clone[G] option.

  • Follow the instructions for the remainder of this section to clone the ansible-wca-demo-kit repository to your local machine[H].


COPY AND PASTE INSTRUCTIONS INTO A VIRTUAL MACHINE

As you are running the lab environment inside a virtual machine (VM), it is not possible to "paste" lab instructions or information from your local machine's clipboard directly into the VM. Instead, you may use the Send Text feature located in the top-center of the VM interface.

  • Place your cursor within the VM where you wish to paste instructions or text from the clipboard

  • Click the Send Text icon[A] to open a pop-up window.

  • Paste your local machine's clipboard contents into the input field[B]

  • Click the Send Text button[C] to the right of the input field to "paste" the contents into the VM

  • Click the X icon[D] to close the pop-up window

If you wish to copy and paste instructions directly from the lab documentation, it is recommended that you open the GitHub instructions inside the VM's web browser (Firefox). This will allow you to copy instructions to the VM's clipboard and paste instructions inside the VS Code editor.



Next steps

The following section will cover the fundamentals of AI-recommended code generation for Ansible Playbooks using IBM watsonx Code Assistant.