VMware Cloud Community
JiGang
Contributor
Contributor

appd.properties not detected for VRA7.4 with Windows 2012

Hi :

     I am trying software components with my blueprint.

     I can confirm that my .Net 3.5 have been installed, and i have my template prepared by following this. Prepare a Windows Reference Machine to Support Software

      but my server provision failed with timeout.

  pastedImage_1.png

     when i login to check the logs. it shows "C:\opt\vmware-appdirector\agent\appd.properties not detected"     

     pastedImage_2.png

     i can see the service is started.

pastedImage_3.png

    

     Did i miss anything?

     Any comments would be highly appreciated.   Thanks.

13 Replies
daphnissov
Immortal
Immortal

You failed on the machine provision, not software component, so you need to look at the error message to determine why.

0 Kudos
JiGang
Contributor
Contributor

Thanks a lot for your quick response.

actually the vm is provisioned. i can login to the VM before it is destroying automatically.

and also i have tried this solution, it doesn't work VMware Knowledge Base

Thanks again.

BTW. do you know where i can check the exactly logs of bootstrap service?

0 Kudos
daphnissov
Immortal
Immortal

There is more to "provisioned" than if the VM is powered on. Look at your error message in your own screenshot. It failed at the provision stage because of an InstallSoftware process (are you installing software via custom properties?). Once again, expand the error message to see where it failed, because it was before when software components run.

0 Kudos
JiGang
Contributor
Contributor

Please find the screenshot below.  the thing is if i manually created the appd.properties,  the whole process can go through.

pastedImage_0.png

Thanks again.

0 Kudos
daphnissov
Immortal
Immortal

This may be the timestamping issue in 7.4. Apply the workaround as noted here and try again.

0 Kudos
JiGang
Contributor
Contributor

Thanks.  Actually, i have already tried this one. (At least the properties file with a timestamp as a postfix should be generated if it is the problem).

but for my problem, there is no files at all.

0 Kudos
daphnissov
Immortal
Immortal

Can you show your c:/opt/vmware-appdirector/agent-bootstrap/vcac-appd-gc.bat file? And are you using linked clones?

0 Kudos
JiGang
Contributor
Contributor

Thanks a lot for  your patience.

pastedImage_0.png

@echo off

REM

REM Copyright (c) 2015-2017 VMware, Inc. All rights reserved.

REM

REM Description:

REM   VMware vRealize Automation Software Agent customization script.

REM     * Create the appd.properties file based on command-line parameters

REM     * The appd.properties file is created under C:\opt\vmware-appdirector\agent

REM

REM Reset error level before beginning this script.

set ERRORLEVEL=0

REM Constants

set APPD_PROPERTIES=appd.properties

set APPD_AGENT_DIRECTORY=C:\opt\vmware-appdirector\agent

set APPD_AGENT_LOGS_DIRECTORY=%APPD_AGENT_DIRECTORY%\logs

set APPD_PROPERTIES_FILE=%APPD_AGENT_DIRECTORY%\%APPD_PROPERTIES%

set CUSTOM_PROPERTIES_FILE=%APPD_AGENT_DIRECTORY%\custom.properties

set VCAC_APPDCUSTOM_LOG=%APPD_AGENT_LOGS_DIRECTORY%\vcac-appd-gc.log

set APPD_AGENT_RAN_FLAG=%APPD_AGENT_DIRECTORY%\agent_ran

set APPD_AGENT_FAILED_FLAG=%APPD_AGENT_DIRECTORY%\bootstrap_failed

set SLEEP_INTERVAL=30

set set APPD_PROPERTIES_INPUT=%APPD_AGENT_DIRECTORY%\appd.properties_%random%

REM Check if agent directory exists?

if not exist %APPD_AGENT_DIRECTORY% (

    mkdir %APPD_AGENT_DIRECTORY%

    )

REM Check if agent logs directory exists?

if not exist %APPD_AGENT_LOGS_DIRECTORY% (

    mkdir %APPD_AGENT_LOGS_DIRECTORY%

    )

call:echo_d INFO "VMware vRealize Automation Software Agent customization script - Begin"

REM Check if an appd.properties file already exists?

if exist %APPD_PROPERTIES_FILE% (

    echo OVERRIDE_ERROR_CONTEXT

    call:echo:d ERROR "Found existing %APPD_PROPERTIES_FILE% file. Failing provisioning, please re-create the template and try again."

    exit 1

)

REM Calling javascript to perform the writing

cscript %~dpn0.js %APPD_PROPERTIES_INPUT% %CUSTOM_PROPERTIES_FILE% %* 2>&1 >> %VCAC_APPDCUSTOM_LOG%

if ERRORLEVEL 1 (

    call:echo_d ERROR "Error writing properties to %APPD_PROPERTIES_INPUT%. Abort."

    echo OVERRIDE_ERROR_CONTEXT

    echo "Error writing properties to %APPD_PROPERTIES_INPUT%"

    exit 1

)

REM Rename the date time stamped temporary file to appd.properties file

ren %APPD_PROPERTIES_INPUT% %APPD_PROPERTIES%

:checkexist

if exist %APPD_AGENT_FAILED_FLAG% (

    echo OVERRIDE_ERROR_CONTEXT

    for /f "skip=1 delims=" %%a in ('type %APPD_AGENT_FAILED_FLAG%') do (

        echo %%a

        exit 1

    )

    echo "Error reading %APPD_AGENT_FAILED_FLAG%"

    exit 1

) else if exist %APPD_AGENT_RAN_FLAG% (

    call:echo_d "vRA Software agent started"

    exit 0

) else (

    call:echo_d INFO "Guest Agent waits %SLEEP_INTERVAL% seconds before re-checking Software Agent progress."

    TIMEOUT /t 30 /nobreak 2>&1 >> %VCAC_APPDCUSTOM_LOG%

    GOTO :checkexist

)

REM The above loop will not reach here.

REM Logging helper function

:echo_d

echo %~1 %date:~10,4%-%date:~4,2%-%date:~7,2% %time:~0,8%,%time:~9,2%0 - %~2 >> %VCAC_APPDCUSTOM_LOG%

:eof

0 Kudos
daphnissov
Immortal
Immortal

You have a duplicate set command so you didn't edit this file correctly.

REM Constants

set APPD_PROPERTIES=appd.properties

set APPD_AGENT_DIRECTORY=C:\opt\vmware-appdirector\agent

set APPD_AGENT_LOGS_DIRECTORY=%APPD_AGENT_DIRECTORY%\logs

set APPD_PROPERTIES_FILE=%APPD_AGENT_DIRECTORY%\%APPD_PROPERTIES%

set CUSTOM_PROPERTIES_FILE=%APPD_AGENT_DIRECTORY%\custom.properties

set VCAC_APPDCUSTOM_LOG=%APPD_AGENT_LOGS_DIRECTORY%\vcac-appd-gc.log

set APPD_AGENT_RAN_FLAG=%APPD_AGENT_DIRECTORY%\agent_ran

set APPD_AGENT_FAILED_FLAG=%APPD_AGENT_DIRECTORY%\bootstrap_failed

set SLEEP_INTERVAL=30

set set APPD_PROPERTIES_INPUT=%APPD_AGENT_DIRECTORY%\appd.properties_%random%

0 Kudos
JiGang
Contributor
Contributor

Good Catch Sir.

After i correct it. i still got same error.   Do you know how to check the exactly output of vcac-appd-gc.bat from windows service.

i would like to see why this file was not created.

0 Kudos
daphnissov
Immortal
Immortal

The output of that file is going to be the property payload, so if it doesn't exist then there's still a problem. Don't know what you mean by "windows service" in this context. What I'd recommend at this point is to run the PS1 script again to uninstall and then re-install the guest and software agents. Modify the same BAT file again if necessary. Convert to template and re-run. Sometimes, especially if this is an upgrade, things get borked with the guest/software agent files and can cause hang-ups and I've seen it several times.

0 Kudos
JiGang
Contributor
Contributor

Sure i will run this to uninstall

C:\opt\vmware-appdirector\agent-bootstrap\appd_bootstrap_removal.bat

And follow Prepare a Windows Reference Machine to Support Software to reinstall and update the bat file.

let's say if i do this on a specific vm and reboot the VM, i should see the appd.properties created successfully.  

is this right?

daphnissov
Immortal
Immortal

No, not the batch file. Get the PS1 script from the vRA appliance that automates the process to install/uninstall the guest agent. When you go through the install process again, it'll detect and uninstall all the previous agents. Once it recreates everything, edit the file as outlined in the KB I linked. Shutdown, convert to template, and try another deploy.

0 Kudos