> Source: [sk181133](https://support.checkpoint.com/results/sk/sk181133)

# sk181133 - "vsenv: failed to find an ID for a VS named <VS_Hostname>" error when changing a Virtual System with the Virtual System Name on Quantum Maestro

| Property | Value |
|----------|-------|
| Solution ID | sk181133 |
| Date Created | 2023-06-26 |
| Last Modified | 2024-01-16 |
| Technical Level | General |
| Products | Security Gateway, Scalable Platforms |
| Versions | R81.20 |
| OS | Gaia |
| Platform | Maestro Orchestrator |

## Symptoms

- This error appears when you try to change the Virtual System (VS) with the name of the VS:   
`vsenv: failed to find an ID for a VS named '<VS_Hostname>'.`

<br />

## Cause

The "`vsenv`" command did not detect that a Scalable Platform is not a cluster. As a result, the script failed with an error.

<br />

## Solution

This problem was fixed. The fix is included in:

* [Jumbo Hotfix Accumulator for R81.20](https://sc1.checkpoint.com/documents/Jumbo_HFA/R81.20/Default.htm) starting from Take 43

If you choose not to upgrade, Check Point can supply a **Hotfix** . [Contact Check Point Support](https://www.checkpoint.com/support-services/contact-support/) to get a Hotfix for this issue.  
A Support Engineer will make sure the Hotfix is compatible with your environment before providing the Hotfix.  
For faster resolution and verification, please collect [CPinfo files](http://supportcontent.checkpoint.com/solutions?id=sk92739) from the Security Management Server and Security Gateways involved in the case.

**Hotfix installation instructions:**   
Refer to [sk168597 - How to install a Hotfix](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk168597).

<br />

This **workaround** is also available. It is necessary to do this workaround for **each**Security Group Member (SGM) in the Security Group.

1. Back up the `/etc/profile.d/vsenv`.sh file:  
   `[expert@hostname]# cp /etc/profile.d/vsenv.sh /etc/profile.d/vsenv.sh_BACKUP`  

2. Edit the `/etc/profile.d/vsenv.sh` file and change line 109   

   from:  
   "`if [ "$ISCLUSTER" -eq "0" ] ; then`"   

   to   
   "`if [ "$ISCLUSTER" -eq "0" ] || [ -f "/etc/.scalable_platform" ] ; then`".   

   **Example** :  
   Show / Hide this section  
   **Before the change:**   

   `function vsenv_get_vsid() {`  
   ` `  
   ` ISCLUSTER="$(cpprod_util fwishighavail)"`  
   ` if [ "$ISCLUSTER" -eq "0" ] ; then`  
   ` FULLVSNAME=$ARG`  
   ` else`  
   ` VS0NAME="$(get_vs0_name)"`  
   ` FULLVSNAME=$VS0NAME"_"$ARG`  
   ` fi`  
   `` for CURRVSID in `dbget -c instance` ; do``  
   `` CURRVSNAME=`dbget instance:$CURRVSID:name```  
   ` echo "Drake: $CURRVSNAME | $FULLVSNAME"`  
   ` if [ "$CURRVSNAME" == "$FULLVSNAME" ] ; then`  
   ` echo $CURRVSID`  
   ` return 0`  
   ` fi`  
   ` done`  
   ` echo -1`  
   ` return -1`  
   `}`  

   **After the change** :  

   `function vsenv_get_vsid() {`  
   ` `  
   ` ISCLUSTER="$(cpprod_util fwishighavail)"`  
   ` if [ "$ISCLUSTER" -eq "0" ] || [ -f "/etc/.scalable_platform" ] ; then`  
   ` FULLVSNAME=$ARG`  
   ` else`  
   ` VS0NAME="$(get_vs0_name)"`  
   ` FULLVSNAME=$VS0NAME"_"$ARG`  
   ` fi`  
   `` for CURRVSID in `dbget -c instance` ; do``  
   `` CURRVSNAME=`dbget instance:$CURRVSID:name```  
   ` echo "Drake: $CURRVSNAME | $FULLVSNAME"`  
   ` if [ "$CURRVSNAME" == "$FULLVSNAME" ] ; then`  
   ` echo $CURRVSID`  
   ` return 0`  
   ` fi`  
   ` done`  
   ` echo -1`  
   ` return -1`  
   `} `  
3. Save the `/etc/profile.d/vsenv.sh` file.  

4. Open a new SSH session.

<br />

---

# Agent Instructions

This content is from the Check Point Support Center (https://support.checkpoint.com), the official knowledge base for Check Point cybersecurity products.

## Navigating This Knowledge Base

- **Complete index**: [llms.txt](https://support.checkpoint.com/llms.txt)
- **All SK articles**: [SecureKnowledge Sitemap](https://support.checkpoint.com/sitemaps/secureknowledge-sitemap-index.xml)
- **SK article URL pattern**: `https://support.checkpoint.com/results/sk/{skId}`
- **Markdown responses**: AI bot User-Agents automatically receive `text/markdown` content
