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 resource to manage virtual disks #558

Merged
merged 3 commits into from
Mar 4, 2024

Conversation

Ikke
Copy link
Contributor

@Ikke Ikke commented Feb 29, 2024

Add support to manage virtual disks, which were added in netbox
3.7.0.

This does affect the netbox_virtual_machine resource because adding virtual disks to a VM does adjust the disk_size_gb property. We solve this by setting that field to computed.

Since the addition of virtual disks, this field represents the aggregate
size of all disks. When adding virtual disks, netbox automatically
updates this field, so it must be a `computed` field to let terraform
know that there can be changes from outside of terraform.
@Ikke
Copy link
Contributor Author

Ikke commented Feb 29, 2024

Needs fbreckle/go-netbox#37 before this works.

@joek-office
Copy link

@Ikke
thank you for your work. I'm also currently looking if i can add this feature and then see your commit. Have opened a issue for that in the last days. #557

@Ikke
Copy link
Contributor Author

Ikke commented Feb 29, 2024

I was working on fbreckle/go-netbox#37 and created this code to verify it actually works.

@Ikke Ikke force-pushed the resource-virtual-disk branch from 3de77f3 to 7435e66 Compare February 29, 2024 13:42
@fbreckle fbreckle marked this pull request as ready for review March 4, 2024 10:53
@fbreckle fbreckle merged commit 807b55c into e-breuninger:master Mar 4, 2024
8 checks passed
@joek-office
Copy link

Hello together,
is it possible to add a data_source virtual_disk? I use the terraform provider to read theses information from the netbox and deploy vm's on a proxmox cluster with the corresponding terraform provider. So having the resource virtual_disk is nice, but for me, the data_source will be more interesting.

@fbreckle
Copy link
Collaborator

It sure is possible, somebody just has to find the time to do it..

#557 stays open as a reminder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants