Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent environment id #444

Closed
ghost opened this issue Jun 30, 2017 · 2 comments
Closed

Inconsistent environment id #444

ghost opened this issue Jun 30, 2017 · 2 comments
Labels
question Further information is requested

Comments

@ghost
Copy link

ghost commented Jun 30, 2017

When deploying with the CLI
inmanta -vvv deploy
I see in the debug logs that this environment ID is present for the agents:

DEBUG    New session for agent iaas_openstack on inmanta-dev
DEBUG    New session for agent internal on inmanta-dev
DEBUG    set session 2a63fa02-5d8e-11e7-9fed-000c29543e51 as primary for agent iaas_openstack in env 29f94ab1-0962-46f9-8157-71f69b450101
DEBUG    set session 2a63fa02-5d8e-11e7-9fed-000c29543e51 as primary for agent internal in env 29f94ab1-0962-46f9-8157-71f69b450101
DEBUG    Started new agent with PID 5370
INFO     ['iaas_openstack', 'internal'] matches agents managed by server, ensuring it is started.
std::AgentConfig[internal,agentname=iaas_openstack],v=1498825082 - deployed
openstack::VirtualMachine[iaas_openstack,name=testhost],v=1498825082 - deployed
openstack::HostPort[iaas_openstack,name=testhost_eth0],v=1498825082 - deployed
[3 / 3]
Deploy ready
DEBUG    expiring session 2a63fa02-5d8e-11e7-9fed-000c29543e51

The .inmanta contains:

[root@inmanta-dev openstack-template]# cat .inmanta 

[config]
heartbeat-interval = 60
fact-expire = 1800
environment=e3cb350c-52b7-461c-90a3-cbc5e04757c5


[compiler_rest_transport]
host = localhost
port = 8888

[cmdline_rest_transport]
host=localhost
port=8888

This environment ID is also not present here:

[root@inmanta-dev openstack-template]# inmanta-cli environment list
+-------------------------+--------------------------------------+-----------------------------+--------------------------------------+
|      Project name       |              Project ID              |         Environment         |            Environment ID            |
+=========================+======================================+=============================+======================================+
| openstack-dev           | 4ad5dad5-4ece-4ca7-9f62-35b66242f7ba | openstack-dev-env           | 177e8866-2a4e-47b0-8230-fff7499a09b6 |
| openstack-template-test | e2c0750d-e2e5-4219-bc4a-afec555925b1 | openstack-template-test-env | e3cb350c-52b7-461c-90a3-cbc5e04757c5 |
+-------------------------+--------------------------------------+-----------------------------+--------------------------------------+

And, of course, if I try to use the env_id variable in a template, like in:

[config]
heartbeat-interval = 60
fact-expire = 60
state-dir=/var/lib/inmanta
environment={{ env_id }}
agent-names=\$node-name

It pushes the wrong environment ID on the created instance:

[config]
heartbeat-interval = 60
fact-expire = 60
state-dir=/var/lib/inmanta
environment=29f94ab1-0962-46f9-8157-71f69b450101

If I deploy it with the GUI, everything is fine:

[config]
heartbeat-interval = 60
fact-expire = 60
state-dir=/var/lib/inmanta
environment=e3cb350c-52b7-461c-90a3-cbc5e04757c5

I can event see the agent in the dashboard:
screen shot 2017-06-30 at 14 31 36

@bartv
Copy link
Contributor

bartv commented Jun 30, 2017

  1. The depoy command is completely standalone. It creates a project and environment specific on the embeded server of the deploy command. This uuid is only shown in log files. Normally it should persist over deploy invocations as long as you keep the data dir in the project directory. Due to bug State of deploy command is not always persisted with embedded mongo #443 no data is persisted at all and every deploy invocation another environment with a new uuid is created.

The deploy command wil NOT work with a server that is running somewhere.

  1. The .inmanta file contains a uuid that you can use to export to a server that is running somewhere. If you do inmanta export it will use the settings in .inmanta (environment id and the connection settings). For example:
[config]
environment=044eccd7-7488-4c27-8735-e5f85d433630

[compiler_rest_transport]
host = dev01.inmanta.com
port = 8080

This uuid has to match with the id on the server. If the environment id does not exist on the server, you will get an error.

The compiler / export command will use the id in .inmanta or the config file passed with -c.

@bartv
Copy link
Contributor

bartv commented Jul 3, 2017

This is not really an issue, can I close it? Or is there something we can do to improve the experience here?

(You may also use the #inmanta irc channel on freenode for questions.)

@bartv bartv added the question Further information is requested label Jul 3, 2017
@ghost ghost closed this as completed Jul 3, 2017
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant