@Barak Sorry to bother you again.
Pre-start agent or cloudify exception cause agent still alive on host, at this time, install an application on this host will throw a file not found exception.
In the whole process of application deployment, the agent installation occupies half the time, so, I want to pre-start agent(use command) in all virtual machines. After start all agent, they can be seen In host tab view of gs-webui, Then when I deploy applications quickly, but at that time, an exception occurred and deployment failed. the exception is :
Failed to execute entry: jetty_install.groovy; Caused by: org.cloudifysource.usm.USMException: Event lifecycle external process exited with abnormal status code: 1 Caught: java.io.FileNotFoundException: /home/vagrant/gigaspaces/work/processing-units/jettyTest_jetty_1_140282317/ext/Xmx512m (/home/vagrant/gigaspaces/work/processing-units/jettyTest_jetty_1_140282317/ext/Xmx512m)
java.io.FileNotFoundException: /home/vagrant/gigaspaces/work/processing-units/jettyTest_jetty_1_140282317/ext/Xmx512m (/home/vagrant/gigaspaces/work/processing-units/jettyTest_jetty_1_140282317/ext/Xmx512m)
Cloudify will only use, or shut down, agents that it has started. So just starting an agent and attaching it to the manager will not work.
You are going to need a custom cloud driver, possibly re-using on the existing BYON cloud driver. This cloud driver will allocate a machine from the pool, launch the process that starts the agent and then passes the compute instance back to Cloudify. In the MachineDetails object that the cloud driver returns, you should set the 'agentRunning' field to true, and Cloudify will use this agent.
For this to work correctly, you will need to generate the required environment file so that the agent is configured to work with the Cluster. You can check out an example here:
https://github.com/CloudifySource/cloudify/blob/master/esc/src/main/java/org/cloudifysource/esc/driver/provisioning/privateEc2/PrivateEC2CloudifyDriver.java
The above example starts a node using CloudFormation, passing it the required settings. See how this is done here:
https://github.com/CloudifySource/cloudify/blob/master/esc/src/main/java/org/cloudifysource/esc/driver/provisioning/privateEc2/PrivateEC2CloudifyDriver.java#L1158