Closed shpsec-dennis closed 6 years ago
Hi @shpsec-dennis - you're research is correct. Subnetworks do not yet exist in libcloud and that has to happen before they can get exposed to the salt-cloud GCE driver.
Could you create a libcloud issue for the feature request and point back to this issue? Also, if you're inclined to do the work, I'd be happy to help review / test.
What is the https://issues.apache.org/jira/browse/LIBCLOUD/ ticket number? Would like to help get this fixed.
I did not create one, sorry about dropping the ball there.
Looks like it's been added:
https://libcloud.readthedocs.io/en/latest/compute/drivers/gce.html
ex_subnetwork (str or GCESubnetwork) – The subnetwork to associate with the node.
I just got this working in salt-cloud, pull request inbound
With this pull request your profile should look like this:
network: mycustomnetwork
subnetwork: mycustomsubnet01
external_ip: mystaticip
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
Hi,
Combing the libcloud (1) and gce provider source code in saltstack(2) and docs I cannot seem to figure out how to create a GCE instance into a custom sub-network either using a profile or salt-module.
Is this support just not existing or can I not figure out how to do it? (similar to EC2: [https://issues.apache.org/jira/browse/LIBCLOUD-579])
If I specify a subnetwork for the network attribute in a cloud-profile it says the network does not exist. If I specify the main network this happens:
So how do I win? Can I not use subnetworks in my project?
(1) [https://github.com/apache/libcloud/blob/trunk/libcloud/compute/drivers/gce.py#L2255] nothing about subnetwork in create_node() unless something else happens.
(2) https://docs.saltstack.com/en/latest/ref/clouds/all/salt.cloud.clouds.gce.html
The google cloud APIs support this: https://cloud.google.com/compute/docs/reference/latest/instances