Comments (6)
Hi @ZauberNerd! 👋🏼
That's an interesting idea! While I'm not opposed to this approach, it won't solve the main problem you're aiming at: eliminating SSH access. We still need SSH to run the custom import command for VM disks, as the PVE API does not allow importing, for example, a qcow2 image stored in the iso storage using import-disk
attribute.
Would you mind sketching an example of a VM resource using this new approach, so we can discuss the details?
I'm also about to start experimenting with the implementation of the initialization section for the new VM2 resource. It would be nice to flesh out some design points around cloud-init.
from terraform-provider-proxmox.
Yes, unfortunately it doesn't solve other file upload issues. As far as I understand, only .iso
and .vztmpl
can be uploaded, right (https://pve.proxmox.com/pve-docs/api-viewer/#/nodes/{node}/storage/{storage}/upload)?
I just checked and the UI creates a raw disk, which can then be configured via the UI. This won't be the case with my proposed solution.
My idea was to specifically target the cloud-init generation:
- add a new
content_type
toproxmox_virtual_environment_file
(e.g.cloud-init
orcloud-init-iso
or something similar) - build an ISO9660 image on the fly via the above mentioned library with the content of
source_file
orsource_raw
and upload it
This would allow to at least eliminate SSH access for a common use case of provisioning cloud-init based VMs.
from terraform-provider-proxmox.
Hey @ZauberNerd !
I just checked and the UI creates a raw disk, which can then be configured via the UI. This won't be the case with my proposed solution.
Yes, and there will be a possibility of having two conflicting cloud-init configs, one from the custom build iso file you're proposing, and another that comes from the initialization
section.
I would prefer to have the new "cloud-init-iso" configuration wrapped up in the initialization
as well. That way we can have some schema rules that could prevent declaring PVE-native cloud-init params when a custom coloud-init files are there.
I'm thinking about a structure like:
initailization {
datastore_id = ...
interface = ...
# all other existing attributes
# but if present alongside the `iso` then provider will throw an error
iso {
meta_data = <<-EOT
...
EOT
user_data = ....
vendor_data = ....
...
}
WDYT?
from terraform-provider-proxmox.
@bpg I like it. But do we then still need the iso
block or could we make meta_data
, user_data
and vendor_data
mutually exclusive to other parameters?
I'm not too well versed in terraform api design, so not sure, if that is a good pattern or not?
from terraform-provider-proxmox.
Yes, we can define constraints on the attribute to make them mutually exclusive. Actually that's what I meant by "throw an error". Provider could do the schema validation when parsing a config, and flag attributes that overwrite each other.
from terraform-provider-proxmox.
There is also a good thread with lots of details about cloud-init behaviour in different cases.
from terraform-provider-proxmox.
Related Issues (20)
- proxmox_virtual_environment_vm.virtual_machine already exists error HOT 2
- Please add new arguments and attributes to the `proxmox_virtual_environment_vms` data source HOT 2
- Unknown timezone "Europe/Amsterdam" with proxmox_virtual_environment_time HOT 2
- Changing disk size of 'proxmox_virtual_environment_container' forces replacement HOT 4
- proxmox_virtual_environment_download_file can't read metadata HOT 2
- CloudImage size changes forces replacement of VM HOT 2
- proxmox_virtual_environment_vm forces replacement by unchanged initialization.user_account.keys HOT 2
- A question about documentation related to the proxmox_virtual_environment_container resource
- Error listing files from datastore using API Token as credentials HOT 2
- Unable to download iso (OpenTofu) HOT 2
- proxmox_virtual_environment_network_linux_bridge additional config
- Weird behaviour with `file_format` vs. multiple disks HOT 2
- Adding VM/container to resource pool when creating HOT 1
- [Datasource - proxmox_virtual_environment_vms] Request fails if one of the nodes of the cluster fails HOT 1
- Confusing error message when cloning a VM with cloud-init to a non-default datastore HOT 3
- Creation of standalone VM disks
- Automatically reboot the VM when parameter changes
- Can't upload snippets by a non-root account to a non-local storage
- Make user password expired HOT 1
- No more than 14 cidr block allowed for ipset
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 terraform-provider-proxmox.