Comments (3)
Thanks for reporting this.
This works as designed / intended. Base compute API declares those arguments to be of a type of NodeImage and NodeSize.
If any of the drivers supports string notation, that's because they don't comply with the base compute API.
In the past, we didn't have a good automated way to enforce compliance with the base API so some things like that have slipped through, but going forward, some of that will be easier with the MyPy support.
In short, in scenarios like that, you need to instantiate NodeImage
and NodeSize
classes yourself manually (although some drivers may offer convenience extension methods for that).
from libcloud.
The biggest issue I see with this is that GCP does not present all of the images as part of list_images (current count is 80 images, and this clearly doesn't include images that are available in the marketplace and the like). If drivers don't present these instances, and it isn't defined HOW to instantiate a NodeImage or NodeSize class, then saying you must use an instance isn't helpful.
Also, GCP does not implement get_image:
>>> drv.get_image('FreeBSD')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/jmg/work/openc2-aws-actuator/p/lib/python3.6/site-packages/libcloud/compute/base.py", line 1343, in get_image
'get_image not implemented for this driver')
NotImplementedError: get_image not implemented for this driver
So, there is no way to create a NodeImage other than the 80 that GCP provide, and that is problematic.
In fact, the docs for NodeImage pretty much tell you NOT to create your own (from https://libcloud.apache.org/apidocs/0.4.2/libcloud.base.NodeImage.html):
NodeImage objects are typically returned by the driver for the cloud provider in response to the list_images function
>>> from libcloud.drivers.dummy import DummyNodeDriver
>>> driver = DummyNodeDriver(0)
>>> image = driver.list_images()[0]
>>> image.name
'Ubuntu 9.10'
Apart from name and id, there is no further standard information; other parameters are stored in a driver specific "extra" variable
When creating a node, a node image should be given as an argument to the create_node function to decide which OS image to use.
>>> node = driver.create_node(image=image)
I'll also note that these docs only say that a NodeImage SHOULD be given instead of MUST be given.
from libcloud.
Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically marking is as stale. If this issue is not relevant or applicable anymore (problem has been fixed in a new version or similar), please close the issue or let us know so we can close it. On the contrary, if the issue is still relevant, there is nothing you need to do, but if you have any additional details or context which would help us when working on this issue, please include it as a comment to this issue.
from libcloud.
Related Issues (20)
- Support for Cloudflare's D1 and/or R2
- Ubuntu 20.04 prohibits TLSv1 by default HOT 3
- Website dark mode blocks top of documentation HOT 6
- Support all S3 storage classes in S3 driver
- Rackspace Cloud Files use_internal_url setting causes exception
- OpenStack driver creates new connection on every request
- Azure arm ex_customdata causes json error HOT 1
- https://github.com/orgs/community/discussions/46887
- Add support for v3applicationcredential in OpenStack driver
- Fix syntax issues in docstrings in the code HOT 1
- Potential Cryptography Issues in file `libcloud/compute/drivers/vsphere.py` HOT 2
- Support for eu-south-1 AWS region.
- Add resize node function for azure driver
- Azure AzureUSGovernment activeDirectoryEndpointUrl changed
- Improper lock usage leads to inode overflow in LockLocalStorage implementation
- Add os_distro and os_version in OpenStack images
- InstanceTypes not available in af-south-1
- urlparse fails with AZURE_BLOBS
- Add support for eu-west-3 AWS region. HOT 1
- Need support for managed identities for azure
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libcloud.