Comments (2)
i do believe this is a limitation of Proxmox itself.
looking at https://pve.proxmox.com/pve-docs/api-viewer/#/nodes/{node}/lxc/{vmid}/clone you can see the parameters Proxmox accepts for a container clone, which doesn't contain any disk related parameters (except for the datastore).
hence, Proxmox will take the existing container and clone it as is. for containers, there's one note in the full
property which i can't interpret so far saying that by default a linked clone is created. maybe that will solve the problem of it going into a loop?
apart from that, you can see the same in the upstream code:
https://github.com/bpg/terraform-provider-proxmox/blob/main/proxmoxtf/resource/container.go#L796 is the code that creates the request parameters, and https://github.com/bpg/terraform-provider-proxmox/blob/main/proxmox/nodes/containers/containers.go#L20 performs the request itself. since you set the clone
parameter you are calling this method chain in https://github.com/bpg/terraform-provider-proxmox/blob/main/proxmoxtf/resource/container.go#L790.
from pulumi-proxmoxve.
Oh well, it was worth a try 😸
I went for re-cloning the template and resizing its disk against the destination datastoreId
, then I clone this clone to get the container.
https://gitlab.com/home.cloud/infra/cloud/-/blob/main/src/ct/index.ts?ref_type=heads#L95-157
create: pulumi.interpolate`
# Check for non-existence of preclone
while pct list | grep -q "^${tempCloneId} "; do
echo "Temporary clone ID ${tempCloneId} is in use. Waiting..."
sleep 5
done
# Perform clone and resize
pct clone ${template.id} ${tempCloneId} --full --storage ${datastoreId} &&
pct resize ${tempCloneId} rootfs ${size}G
`
As I'm creating multiple containers and Proxmox locks the template while it's cloning it, we need to serialize everything. It looks pretty bad, but seems to work. A better design would be to create a higher level ProxmoxVE Dynamic Provider (haha) to hide away all these remote.Command
s and bypass this limitation:
Thanks for helping me understand what's going on under the hood!
from pulumi-proxmoxve.
Related Issues (20)
- Startup/Shutdown options require the up_delay and down_delay to be set up HOT 4
- Are there any plans on supporting LXC containers? HOT 2
- VirtualMachineDiskSpeedArgs HOT 1
- Lack of python documentation
- No parity with upstream tf proxmox provider HOT 3
- Disable default values? HOT 1
- Get config of existing vm HOT 7
- Empty/non set container features forces replacement on import
- How to disable replacing CTs on `pulumi up`? HOT 4
- C# SDK CloudInit not take care or configuration on deploy HOT 3
- Add HA group support HOT 4
- Missing pool id after pool import leads to recreating the pool HOT 3
- timeouts does not apply all the time HOT 2
- Invalid Go SDK module HOT 2
- error retrieving next VM ID: received an HTTP 401 response - Reason: no such token 'TOKENID' for user 'dev@pve' HOT 1
- how to specifiy a config file to uploaded to vm then genereate seed.iso to setup vm with cloudinit? HOT 3
- pulumi hangs if passing the 'started: true' option. HOT 4
- How to print the local IP out that qemu-guest-agent displays? HOT 3
- No option to Link clone a container HOT 3
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 pulumi-proxmoxve.