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

Build and deploy a FDU on a node? #146

Closed
zrnapoleon opened this issue Sep 2, 2019 · 10 comments
Closed

Build and deploy a FDU on a node? #146

zrnapoleon opened this issue Sep 2, 2019 · 10 comments

Comments

@zrnapoleon
Copy link

For now, I have successfully installed the fog with its 5 plugins. But when i tried to deploy a LXD FDU:
$ python3 lifecycle_non_lxd_test.py 127.0.0.1:7887 fdu_lxd_test.json
Here lifecycle_non_lxd_test.py and fdu_lxd_test.json are based on:
https://github.com/atolab/fog05_demo/blob/master/fim_api/lifecycle_nonetwork.py
and
https://github.com/atolab/fog05_demo/blob/master/fim_api/fdu_lxd.json
with mu node ID:
image
and the net interface:
image
I got the following error:
image

Json and Python fiches.zip
Hope you can give me some help, thanks!

@gabrik
Copy link
Contributor

gabrik commented Sep 2, 2019

Hi @zrnapoleon, can you please paste the output of the LXD plugin?

This seems related to some permission issue to the user that is running the LXD plugin, to I guess we can get more information from that log

@zrnapoleon
Copy link
Author

Hi @gabrik , the output of LXD plugin:
image

@gabrik
Copy link
Contributor

gabrik commented Sep 2, 2019

I see, this is some strange permisison error coming from LXD APIs.

Try to run this:

$ sudo -u fos python3
> from pylxd import Client
> c = Client()
> c.profiles.create('test') 

You should get the same error, can you confirm?

@zrnapoleon
Copy link
Author

I did, but got a conection error when I rename the c = Client() before passing the test:

Error.txt

@gabrik
Copy link
Contributor

gabrik commented Sep 2, 2019

Ok, I still think LXD as some strange configuration.

Try this:

$ sudo -u fos python3
> from pylxd import Client
> c = Client(endpoint='https://127.0.0.1:8443', verify=False)
> c.profiles.create('test') 

And you should get the same unauthorized error

@zrnapoleon
Copy link
Author

image
Yeah, it is, It return the same error : nor authorized

@gabrik
Copy link
Contributor

gabrik commented Sep 2, 2019

Ok, can you paste the output of:

$ sudo -u fos groups

On our test machine it returns fos sudo lxd, you should get the same

@zrnapoleon
Copy link
Author

Yeah , it is:
ubuntu@chenyanjun-3:~/fog05_demo/fim_api$ sudo -u fos groups
fos sudo lxd

@gabrik
Copy link
Contributor

gabrik commented Sep 3, 2019

After some investigation, this can be related to canonical/pylxd#365, so you can try to add this environment variable in a system-wide manner:

echo "export LXD_DIR=/var/snap/lxd/common/lxd" >> /etc/environment/

Edit: you may need to reboot

@gabrik
Copy link
Contributor

gabrik commented Sep 4, 2019

Fixed by #147

@gabrik gabrik closed this as completed Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants