salt-cloud --list-images doesn't list all DigitalOcean images
Looks like salt-cloud isn't fetching additional pages from the API when finding images. docl appears to fetch everything correctly, so I don't think it's an issue on the DigitalOcean side.
note: I've removed four private images from the salt-cloud --list-images digitalocean output.
slightly more complete example of how it fails
$ salt-cloud --list-images digitalocean
digitalocean:
----------
digital_ocean:
----------
14.10 x32:
----------
created_at:
2014-10-23T14:30:12Z
distribution:
Ubuntu
id:
7111572
name:
14.10 x32
public:
True
regions:
[u'nyc1', u'ams1', u'sfo1', u'nyc2', u'ams2', u'sgp1', u'lon1', u'nyc3', u'ams3', u'nyc3']
slug:
ubuntu-14-10-x32
19 x32:
----------
created_at:
2014-09-26T15:33:39Z
distribution:
Fedora
id:
6370969
name:
19 x32
public:
True
regions:
[u'nyc1', u'ams1', u'sfo1', u'nyc2', u'ams2', u'sgp1', u'lon1', u'nyc3', u'ams3', u'nyc3']
slug:
fedora-19-x32
19 x64:
----------
created_at:
2014-09-26T15:33:05Z
distribution:
Fedora
id:
6370968
name:
19 x64
public:
True
regions:
[u'nyc1', u'ams1', u'sfo1', u'nyc2', u'ams2', u'sgp1', u'lon1', u'nyc3', u'ams3', u'nyc3']
slug:
fedora-19-x64
20 x32:
----------
created_at:
2014-09-26T15:29:18Z
distribution:
Fedora
id:
6370885
name:
20 x32
public:
True
regions:
[u'nyc1', u'ams1', u'sfo1', u'nyc2', u'ams2', u'sgp1', u'lon1', u'nyc3', u'ams3', u'nyc3']
slug:
fedora-20-x32
20 x64:
----------
created_at:
2014-09-26T15:29:01Z
distribution:
Fedora
id:
6370882
name:
20 x64
public:
True
regions:
[u'nyc1', u'ams1', u'sfo1', u'nyc2', u'ams2', u'sgp1', u'lon1', u'nyc3', u'ams3', u'nyc3']
slug:
fedora-20-x64
444.5.0 (beta):
----------
created_at:
2014-10-16T17:43:33Z
distribution:
CoreOS
id:
6882384
name:
444.5.0 (beta)
public:
True
regions:
[u'sfo1', u'nyc2', u'ams2', u'sgp1', u'lon1', u'nyc3', u'ams3', u'nyc3']
slug:
coreos-beta
444.5.0 (stable):
----------
created_at:
2014-10-16T20:36:29Z
distribution:
CoreOS
id:
6886342
name:
444.5.0 (stable)
public:
True
regions:
[u'sfo1', u'nyc2', u'ams2', u'sgp1', u'lon1', u'nyc3', u'ams3', u'nyc3']
slug:
coreos-stable
472.0.0 (alpha):
----------
created_at:
2014-10-17T20:32:20Z
distribution:
CoreOS
id:
6919197
name:
472.0.0 (alpha)
public:
True
regions:
[u'nyc1', u'ams1', u'sfo1', u'nyc2', u'ams2', u'sgp1', u'lon1', u'nyc3', u'ams3', u'nyc3']
slug:
coreos-alpha
5.10 x32:
----------
created_at:
2014-09-26T16:45:29Z
distribution:
CentOS
id:
6372425
name:
5.10 x32
public:
True
regions:
[u'nyc1', u'ams1', u'sfo1', u'nyc2', u'ams2', u'sgp1', u'lon1', u'nyc3', u'ams3', u'nyc3']
slug:
centos-5-8-x32
5.10 x64:
----------
created_at:
2014-09-26T16:40:18Z
distribution:
CentOS
id:
6372321
name:
5.10 x64
public:
True
regions:
[u'nyc1', u'ams1', u'sfo1', u'nyc2', u'ams2', u'sgp1', u'lon1', u'nyc3', u'ams3', u'nyc3']
slug:
centos-5-8-x64
6.0 x32:
----------
created_at:
2014-09-26T17:00:21Z
distribution:
Debian
id:
6372662
name:
6.0 x32
public:
True
regions:
[u'nyc1', u'ams1', u'sfo1', u'nyc2', u'ams2', u'sgp1', u'lon1', u'nyc3', u'ams3', u'nyc3']
slug:
debian-6-0-x32
6.0 x64:
----------
created_at:
2014-09-26T16:56:00Z
distribution:
Debian
id:
6372581
name:
6.0 x64
public:
True
regions:
[u'nyc1', u'ams1', u'sfo1', u'nyc2', u'ams2', u'sgp1', u'lon1', u'nyc3', u'ams3', u'nyc3']
slug:
debian-6-0-x64
6.5 x32:
----------
created_at:
2014-09-26T16:28:33Z
distribution:
CentOS
id:
6372105
name:
6.5 x32
public:
True
regions:
[u'nyc1', u'ams1', u'sfo1', u'nyc2', u'ams2', u'sgp1', u'lon1', u'nyc3', u'ams3', u'nyc3']
slug:
centos-6-5-x32
6.5 x64:
----------
created_at:
2014-09-26T16:28:43Z
distribution:
CentOS
id:
6372108
name:
6.5 x64
public:
True
regions:
[u'nyc1', u'ams1', u'sfo1', u'nyc2', u'ams2', u'sgp1', u'lon1', u'nyc3', u'ams3', u'nyc3']
slug:
centos-6-5-x64
7.0 x32:
----------
created_at:
2014-09-26T16:53:06Z
distribution:
Debian
id:
6372528
name:
7.0 x32
public:
True
regions:
[u'nyc1', u'ams1', u'sfo1', u'nyc2', u'ams2', u'sgp1', u'lon1', u'nyc3', u'ams3', u'nyc3']
slug:
debian-7-0-x32
7.0 x64:
----------
created_at:
2014-09-26T16:52:46Z
distribution:
Debian
id:
6372526
name:
7.0 x64
public:
True
regions:
[u'nyc1', u'ams1', u'sfo1', u'nyc2', u'ams2', u'sgp1', u'lon1', u'nyc3', u'ams3', u'nyc3']
slug:
debian-7-0-x64
$ docl images -p
10.04 x32 (ubuntu-10-04-x32, id: 6374125)
10.04 x64 (ubuntu-10-04-x64, id: 6374124)
12.04.5 x32 (ubuntu-12-04-x32, id: 6374130)
12.04.5 x64 (ubuntu-12-04-x64, id: 6374128)
14.04 x32 (ubuntu-14-04-x32, id: 6918735)
14.04 x64 (ubuntu-14-04-x64, id: 6918990)
14.10 x32 (ubuntu-14-10-x32, id: 7111572)
14.10 x64 (ubuntu-14-10-x64, id: 7111343)
19 x32 (fedora-19-x32, id: 6370969)
19 x64 (fedora-19-x64, id: 6370968)
20 x32 (fedora-20-x32, id: 6370885)
20 x64 (fedora-20-x64, id: 6370882)
444.5.0 (beta) (coreos-beta, id: 6882384)
444.5.0 (stable) (coreos-stable, id: 6886342)
472.0.0 (alpha) (coreos-alpha, id: 6919197)
5.10 x32 (centos-5-8-x32, id: 6372425)
5.10 x64 (centos-5-8-x64, id: 6372321)
6.0 x32 (debian-6-0-x32, id: 6372662)
6.0 x64 (debian-6-0-x64, id: 6372581)
6.5 x32 (centos-6-5-x32, id: 6372105)
6.5 x64 (centos-6-5-x64, id: 6372108)
7.0 x32 (debian-7-0-x32, id: 6372528)
7.0 x64 (debian-7-0-x64, id: 6372526)
7.0 x64 (centos-7-0-x64, id: 7053293)
Django on 14.04 (django, id: 6734697)
Docker 1.3.0 on 14.04 (docker, id: 6882330)
Dokku v0.2.3 on 14.04 (w/ Docker 1.2.0) (dokku, id: 6738037)
Drupal 7.32 on 14.04 (drupal, id: 6854006)
Ghost 0.5.2 on 14.04 (ghost, id: 6798593)
GitLab 7.3.2 CE on 14.04 (gitlab, id: 6680438)
LAMP on 14.04 (lamp, id: 6732691)
LEMP on 14.04 (lemp, id: 6732690)
MEAN on 14.04 (mean, id: 6798184)
Magento 1.9.0.1 on 14.04 (magento, id: 6884371)
Redmine on 14.04 (redmine, id: 6374427)
Ruby on Rails on 14.04 (Nginx + Unicorn) (id: 6376601)
WordPress on 14.04 (id: 6423475)
node-v0.10.32 on 14.04 (node, id: 6734341)
$ salt --versions
Salt: 2014.7.0-886-g7b3d76b
Python: 2.7.8 (default, Oct 3 2014, 20:39:45)
Jinja2: 2.7.3
M2Crypto: 0.22
msgpack-python: 0.4.2
msgpack-pure: Not Installed
pycrypto: 2.6.1
libnacl: Not Installed
PyYAML: 3.11
ioflo: Not Installed
PyZMQ: 14.4.0
RAET: Not Installed
ZMQ: 4.0.5
Mako: Not Installed
Digital Ocean seems to have changed the images names, they are no longer unique.
/usr/share/pyshared/salt/cloud/clouds/digital_ocean.py
def avail_images(call=None):
[...]
ret = {}
for image in items['images']:
ret[image['name']] = {}
for item in image.keys():
ret[image['name']][item] = str(image[item])
As image['name'] is non unique it overwrites the former entries in the object.
--- digital_ocean.py.orig 2014-10-24 11:45:37.063257021 +0000
+++ digital_ocean.py 2014-10-24 11:45:46.303257020 +0000
@@ -257,11 +257,14 @@
},
)
+ if (vm_['image_id'] is None):
+ vm_['image_id'] = get_image(vm)
+
log.info('Creating Cloud VM {0}'.format(vm_['name']))
kwargs = {
'name': vm_['name'],
'size_id': get_size(vm_),
- 'image_id': get_image(vm_),
+ 'image_id': vm_['image_id'],
'region_id': get_location(vm_),
}
ssh_key_name = config.get_cloud_config_value(
With patch above it enables you at least creating droplets again, in the config simple replace the string "image: [string]" to "image_id: [id]"