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

Add Vultr support #827

Merged
merged 37 commits into from
Apr 13, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
991444a
merged in upstream
ddymko Mar 1, 2021
584fd40
merge conflicts
ddymko Mar 1, 2021
a787657
fixing merge issues
ddymko Mar 1, 2021
7431c4c
cleaning up readme
ddymko Mar 1, 2021
e7ca197
added ddymko to cla signers
ddymko Mar 1, 2021
fc769fc
Requested Changes
Mar 4, 2021
c70c644
Add to signers
Mar 4, 2021
2d04eff
Make new requested changes
Mar 5, 2021
ca7149f
Make new requested changes
Mar 5, 2021
41476a0
Make new requested changes
Mar 5, 2021
671ede5
Merge pull request #8 from eb3095/vultr-cloudinit
ddymko Mar 5, 2021
66813df
Merge branch 'master' into vultr-cloudinit
ddymko Mar 5, 2021
a4e69ca
Merge branch 'master' into vultr-cloudinit
ddymko Mar 8, 2021
8f0c479
Fix upcload case
Mar 8, 2021
0f9e0e8
Merge remote-tracking branch 'upstream/master' into vultr-cloudinit
ddymko Mar 8, 2021
f7c9dca
Make remaining changes
Mar 8, 2021
62c4e99
Fix typo
Mar 8, 2021
5193ad6
Fix typo
Mar 8, 2021
4872462
Merge pull request #10 from eb3095/vultr-cloudinit
ddymko Mar 9, 2021
3805fe5
Wave one of requested changes
Mar 9, 2021
1596185
Wave two of requested changes
Mar 10, 2021
decfddc
Fix debug calls
Mar 10, 2021
889a932
Fix debug calls
Mar 10, 2021
55af391
Merge remote-tracking branch 'upstream/master' into benner-fixes
ddymko Mar 18, 2021
0b6093c
Adjust ethtool usage and v1 changes
Mar 31, 2021
24c182d
Merge remote-tracking branch 'upstream/master' into vultr-cloudinit
ddymko Apr 1, 2021
2c72f3f
Merge pull request #13 from eb3095/vultr-cloudinit
ddymko Apr 1, 2021
6f1698e
Cleanup
Apr 2, 2021
5be0868
Merge pull request #14 from eb3095/vultr-cloudinit
ddymko Apr 2, 2021
d2924aa
Merge branch 'master' into vultr-cloudinit
eb3095 Apr 12, 2021
9971254
Merge remote-tracking branch 'upstream/vultr-cloudinit' into vultr-cl…
Apr 12, 2021
70f4e9e
Remove excess lines
Apr 12, 2021
db18ba1
Merge pull request #15 from eb3095/vultr-cloudinit
ddymko Apr 12, 2021
e4b1348
Merge branch 'master' into vultr-cloudinit
ddymko Apr 13, 2021
c7edc51
Merge remote-tracking branch 'upstream/vultr-cloudinit' into vultr-cl…
Apr 13, 2021
07e9f5a
Cleanup variable usage for network generation
Apr 13, 2021
eab53d1
Merge pull request #16 from eb3095/vultr-cloudinit
ddymko Apr 13, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions cloudinit/sources/DataSourceVultr.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _get_data(self):

LOG.debug("Machine is a Vultr instance")

smoser marked this conversation as resolved.
Show resolved Hide resolved
config = vultr.generate_config(BUILTIN_DS_CONFIG)
config = vultr.generate_config(self.ds_cfg)

# Dump vendor config so diagnosing failures is manageable
LOG.debug("Vultr Vendor Config:")
Expand Down Expand Up @@ -82,16 +82,16 @@ def _get_data(self):

# Get the metadata by flag
def get_metadata(self):
return vultr.get_cached_metadata(BUILTIN_DS_CONFIG)
return vultr.get_cached_metadata(self.ds_cfg)

# Compare subid as instance id
def check_instance_id(self, sys_cfg):
if not vultr.is_vultr():
return None
return False

# Baremetal has no way to implement this in local
if vultr.is_baremetal():
return None
return False

subid = vultr.get_sysinfo()['subid']
return sources.instance_id_matches_system_uuid(subid)
Expand All @@ -104,12 +104,7 @@ def launch_index(self):
# Write the base configs every time. These are subject to change
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this comment is out of place.

@property
def network_config(self):
config = vultr.generate_network_config(BUILTIN_DS_CONFIG)
config_raw = json.dumps(config)

# Dump network config so diagnosing failures is manageable
LOG.debug("Generated Network:")
LOG.debug(config_raw)
config = vultr.generate_network_config(self.ds_cfg)

return config

Expand All @@ -135,7 +130,7 @@ def get_datasource_list(depends):
config = vultr.generate_config(BUILTIN_DS_CONFIG)
sysinfo = vultr.get_sysinfo()

print(json.dumps(sysinfo, indent=1))
print(json.dumps(config, indent=1))
print(util.json_dumps(sysinfo))
print(util.json_dumps(config))

# vi: ts=4 expandtab
3 changes: 1 addition & 2 deletions cloudinit/sources/helpers/vultr.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ def get_metadata(params):
# Fetch the metadata
v1 = fetch_metadata(params)
except (NoDHCPLeaseError) as exc:
LOG.error("DHCP failed, cannot continue. Exception: %s",
exc)
LOG.error("Bailing, DHCP Exception: %s", exc)
raise

v1_json = json.loads(v1)
Expand Down
2 changes: 1 addition & 1 deletion tools/ds-identify
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ DI_DSNAME=""
# be searched if there is no setting found in config.
DI_DSLIST_DEFAULT="MAAS ConfigDrive NoCloud AltCloud Azure Bigstep \
CloudSigma CloudStack DigitalOcean Vultr AliYun Ec2 GCE OpenNebula OpenStack \
OVF SmartOS Scaleway Hetzner IBMCloud Oracle Exoscale RbxCloud upCloud"
OVF SmartOS Scaleway Hetzner IBMCloud Oracle Exoscale RbxCloud UpCloud"
DI_DSLIST=""
DI_MODE=""
DI_ON_FOUND=""
Expand Down