from pylxd import Client
lxd=Client()
images = lxd.images.all() # take the local available images as Python objects
ServerServicesImagesNames = [] # a list with the Images names
if(len(images)!=0):
for i in range(len(images)):
ServerServicesImagesNames.append(images[i].aliases[0]["name"])
#endfor
#endif
print(ServerServicesImagesNames)
root@Server1:~ lxc image list
+--------------+--------------+--------+------------------------------------+--------+-----------+-----------------------------+
| ALIAS | FINGERPRINT | PUBLIC | DESCRIPTION | ARCH | SIZE | UPLOAD DATE |
+--------------+--------------+--------+------------------------------------+--------+-----------+-----------------------------+
| DetectionSvc | d2caa7d55e0e | no | Ubuntu 18.04 LTS server (20200722) | x86_64 | 2433.84MB | Feb 1, 2021 at 5:50pm (UTC) |
+--------------+--------------+--------+------------------------------------+--------+-----------+-----------------------------+
root@Server1:~ python3 sample_script.py
[]
I have installed pylxd inside Server1 container (ubuntu:18.04). Running the above script gives me the above output. In general it seems not to work. I can’t also create a container using pylxd.
Did anyone have the same problem ?