Top
ServerView Resource Orchestrator V3.4.0 Automatic Quarantining Function User's Guide
FUJITSU Software

3.2.4.1 Creating the Script for Linking with L-Servers

When automatically linking added virtual PCs with L-Servers, the administrator creates the following scripts and definition files.

Storage Destination Server for the Script for Linking with L-Servers

The Resource Orchestrator admin server

File Name of the Script for Linking with L-Servers

Any desired string of alphanumeric characters, with the extension "bat".

Character Code

Shift-JIS

Exit Status
0

The command executed successfully.

non-zero

An error has occurred.

Content of the Script for Linking with L-Servers

The content of the script for linking with L-Servers is as follows.

@echo off 

setlocal enabledelayedexpansion 

set AUTO_CONVERT_PATH=%~dp0 
set RUN_SCRIPT="Installation_folder\SVROR\Manager\bin\convertVMtoLServer" 
set CSVPATH=Absolute_path_of_the_folder_for_storing_the_CSV_configuration_file 
set CSVFILE=convertVMtoLserver.csv 
set CSVFULLPATH=%CSVPATH%\%CSVFILE% 
set CSVTEMP=%CSVPATH%\temp.csv 
set UNCONVERT_VMNAMES=%AUTO_CONVERT_PATH%\unconvert_vmname.txt 
set RESULTCSVFILE=%CSVPATH%\convertVMtoLserver_result.csv 

echo [%DATE:/=-% %TIME%] auto convert Start 
call %RUN_SCRIPT% -exportfile "%CSVPATH%" -fixfilename 

if not !errorlevel!==0 ( 
 echo make csv file failed. 
 echo [%DATE:/=-% %TIME%] auto convert End 
 exit /b 1 
) else ( 
 if exist "%UNCONVERT_VMNAMES%" ( 
  for %%a in ("%UNCONVERT_VMNAMES%") do ( 
   if not "%%~za" equ "0" ( 
    for /f "tokens=1 delims=" %%i in ('findstr /v /g:"%UNCONVERT_VMNAMES%" "%CSVFULLPATH%"') do ( 
                                                                          echo %%i>>"%CSVTEMP%") 
    del "%CSVFULLPATH%" 
    ren "%CSVTEMP%" "%CSVFILE%" 
   ) 
  ) 
 ) 
 call %RUN_SCRIPT% -file "%CSVFULLPATH%" 
 if not !errorlevel!==0 ( 
  echo display convertVMtoLserver.csv start 
  for /f "tokens=*" %%a in (%RESULTCSVFILE%) do echo %%a 
  echo display convertVMtoLserver.csv end 
  echo convert lserver or make xml file failed. 
  echo [%DATE:/=-% %TIME%] auto convert End 
  exit /b 1 
 ) 
) 
echo convert lserver is successfully completed. 
echo [%DATE:/=-% %TIME%] auto convert End 
exit /b 0

Note

  • If you linked virtual PCs by executing the convertVMtoLServer command with the -fixfilename option specified, the CSV results file will always be named "convertVMtoLserver_result.csv".
  • If there is already a CSV results file with the same name in the output destination directory, that CSV file will be deleted and then re-created. If the convertVMtoLServer command is executed with the -file option specified and the exit status is something other than "0", the contents of the CSV results file will be output to standard output.
  • Only alphanumeric characters, underscores ("_"), and hyphens ("-") can be used in the absolute path of the folder for storing the CSV configuration file.
Content of the Definition File for Excluding Virtual PCs from the Targets of Batch Linking

The content of the definition file for excluding virtual PCs from the targets of batch linking is shown below.

By specifying resource pool names, VM host names, and virtual PC names, it is possible to exclude specific virtual PCs from being linked as a batch.

Format of the Definition File for Excluding Virtual PCs from the Targets of Batch Linking
Location of the Definition File

The same folder as the script for linking with L-Servers

Name of the Definition File

unconvert_vmname.txt

Character Code

Shift-JIS

Line Break Code

CR/LF

Format of the Definition File

Describe the file using the following format. Do not enter blank spaces or empty lines.

/Resource_pool_name/VM_host_name/Name_of_virtual_PC_1_to_be_excluded_from_the_targets_of_batch_linking 
/Resource_pool_name/VM_host_name/Name_of_virtual_PC_2_to_be_excluded_from_the_targets_of_batch_linking

Example

/VMHostPool/vmesx3/win2008

/VMHostPool/vmesx2/win2003