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

gce: support preemptible instances #31606

Closed
jparal opened this issue Mar 2, 2016 · 5 comments
Closed

gce: support preemptible instances #31606

jparal opened this issue Mar 2, 2016 · 5 comments
Labels
Feature new functionality including changes to functionality and code refactors, etc. RIoT Relates to integration with cloud providers, hypervisors, API-based services, etc. Salt-Cloud stale
Milestone

Comments

@jparal
Copy link

jparal commented Mar 2, 2016

it seems that libcloud supports preemptible instances on GCE using ex_preemptible argument:

http://libcloud.readthedocs.org/en/latest/compute/drivers/gce.html

any plans on supporting this in salt-cloud?
thx

@jfindlay jfindlay added Feature new functionality including changes to functionality and code refactors, etc. Salt-Cloud RIoT Relates to integration with cloud providers, hypervisors, API-based services, etc. labels Mar 2, 2016
@jfindlay jfindlay added this to the Approved milestone Mar 2, 2016
@jfindlay
Copy link
Contributor

jfindlay commented Mar 2, 2016

@jparal, thanks for reporting. I think this is something that we can support.

@cconrad
Copy link

cconrad commented Apr 23, 2016

+1

@rodoyle
Copy link

rodoyle commented Dec 1, 2016

+1

It appears that the kwargs dictionary in the gce client is simply not bringing in the 'ex_preemptible' setting. It could be as simple as extending this, though how to test it properly escapes me at the moment.

@OrlandoArcapix
Copy link
Contributor

Just quickly patched this in to gce.py and tested working okay:

index 9a4f5e3..e7bfa10 100644
--- a/salt/cloud/clouds/gce.py
+++ b/salt/cloud/clouds/gce.py
@@ -2255,7 +2255,9 @@ def request_instance(vm_):
             'ex_service_accounts': config.get_cloud_config_value(
                 'ex_service_accounts', vm_, __opts__, default=None),
             'ex_can_ip_forward': config.get_cloud_config_value(
-                'ip_forwarding', vm_, __opts__, default=False
+                'ip_forwarding', vm_, __opts__, default=False),
+           'ex_preemptible': config.get_cloud_config_value(
+               'preemptible', vm_, __opts__, default=False
             )
         })
         if kwargs.get('ex_disk_type') not in ('pd-standard', 'pd-ssd'):

Together with the option in the cloud-profile

  preemptible: true

User test results after creating one with "preemptible: true" and one without preemptible set as an option:

$ gcloud compute instances list | egrep '(preempt|NAME)'
NAME                 ZONE            MACHINE_TYPE   PREEMPTIBLE  INTERNAL_IP  EXTERNAL_IP     STATUS
notpreempttest01     europe-west1-b  n1-standard-1               xx.xxx.x.x   xxx.xxx.xxx.xx  RUNNING
preempttest01        europe-west1-b  n1-standard-1  true         xx.xxx.x.x   xxx.xxx.xx.x    RUNNING

Looks like it will require libcloud > 0.20.0: https://libcloud.readthedocs.io/en/latest/changelog.html#id31

OrlandoArcapix added a commit to OrlandoArcapix/salt that referenced this issue Jan 10, 2017
cachedout pushed a commit that referenced this issue Jan 10, 2017
…le_gce

Added preemptible flag to gce.py - see issue #31606
gitebra pushed a commit to gitebra/salt that referenced this issue Jan 11, 2017
* upstream/develop:
  Remove trailing whitespace
  Added preemptible flag to gce.py - see issue saltstack#31606
  Various improvements for the hipchat engine
  Move to getfullargspec() for py3 in vsphere module
  Add changes to raetkey
  add note related to issue saltstack#37027
  network.ifacestartswith throws exception on Solaris-like platforms
  Fix saltstack#38595 - Unexpected error log from redis retuner in master's log
  pillar.get: Raise exception when merge=True and default is not a dict
  Avoid errors when sudo_user is set
  State Gem: fix incorrect warning about missing rvm/rbenv
  Change daemontools __virtualname__ from service to daemontools
  Create queue if one doesn't exist
  Add hash_type argument to MultiKeyCLI.finger_all function
  Add hash_type argument to key module fingerprint functions
  Add hash_type argument to wheel fingerprint functions
  Add finger_master function to wheel.key module
  Fix eauth error with openLDAP/389 directory server groups
@stale
Copy link

stale bot commented Aug 23, 2018

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.

@stale stale bot added the stale label Aug 23, 2018
@stale stale bot closed this as completed Aug 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature new functionality including changes to functionality and code refactors, etc. RIoT Relates to integration with cloud providers, hypervisors, API-based services, etc. Salt-Cloud stale
Projects
None yet
Development

No branches or pull requests

5 participants