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

Disk resize on image based host creation #80

Closed
pdzionek opened this issue Apr 30, 2019 · 9 comments
Closed

Disk resize on image based host creation #80

pdzionek opened this issue Apr 30, 2019 · 9 comments
Labels
enhancement New feature or request
Milestone

Comments

@pdzionek
Copy link

Is your feature request related to a problem? Please describe.
If you create a new VM using the image based provisioning, it would be nice to run a resize on a cloned template disk. Right now, it only clones a template and run some configure things. Therefore, we always start with a same OS disk size.

Describe the solution you'd like
Plugin should create a new VM by cloning existing template and resize cloned disk to size specified in VM Creation process. Before resizing, it should check if cloned template disk size is smaller than a disk size requested by the user.

Additional context
I am aware that there could be templates with more than a one disk, but in most scenarios, you clone a template with only one disk containing your OS. So it should only be limited to this use case.

And one more thing, as soon as, cloud init, is done, this will work perfectly with a finish scripts, which would login and grow your FS to maximum specified size.

@tristanrobert
Copy link
Collaborator

I don't quite understand your feature. You could first resize your disk (plugin version >= 0.7) and then clone your vm. Doing many operations all in one may be usefull for you but I am not sure it will be for everybody. Keeping it simple and atomic should be better for everybody.

@pdzionek
Copy link
Author

pdzionek commented Apr 30, 2019

This way you could automate the whole process of provisioning this type of VM (image based provisioning). So steps would be for Create Host like:

  1. Clone a specific template based on user choice.
  2. Resize OS disk to size specified by a user.
  3. Provide cloud init data (I saw that this is on todo list)
  4. Start a VM - (now it doesn't start a VM, it would be nice to have this as a feature)
  5. Run finish script, which will login, resize disk, install all things you need, puppet and more.
  6. Done. Installation finished, without login to Proxmox even once.

As an example, this type of provisioning you can achieve with simple libvirt/KVM and pxe/dhcp provisioning. Where you don't have to login to kvm machine console or GUI at all. Foreman is able to deploy everything by itself. It creates VM, set disks, boots the vm, provides data via pxe/dhcp and installs whole OS. I think that the same thing is possible with proxmox with pxe/dhcp (didn't it try yet, because of instability, right now) and it would be nice to have something similar with image based provisioning.

This is just an idea, based on what I was doing while working with libvirt, foreman and proxmox.

@tristanrobert
Copy link
Collaborator

  1. included since 0.5
  2. included since 0.8
  3. planned in 0.8
  4. included since 0.5
  5. included in foreman (see provisionning templates)

@pdzionek
Copy link
Author

Yes, I am aware of all of this, but you are still unable to do it with one "Submit click" from Create Host.
I have to manually click edit and resize vm for already created host. I have to manually click start in Foreman. Foreman after submiting vm doesn't start VM, I have to do it via Start button for already created host or via Proxmox GUI. Therefore, it is hard to call it an unattended installation.

@tristanrobert
Copy link
Collaborator

tristanrobert commented Apr 30, 2019

If you need to resize your disk, maybe your initial size is not sufficient. You can automatically start a VM at boot when you specify onboot=true. You could add a cdrom iso image to boot in. You will need a provision template to automate anything else. In Debian you can use preseed templates to automate this. iPXE templates (tft server) are another tools to automate provisionning, etc.

@pdzionek
Copy link
Author

pdzionek commented May 6, 2019

@tristanrobert I use predefined Ubuntu Cloud Images, which are already prepared to be used on cloud systems. e.g. bionic prepared image has by default 2,2 GB size. My idea here was not to edit manually, but let, like in other Cloud solution, foreman do a resize on creation and later run growfs/resize2fs in finish script. Therefore, you could set a main disk size to whatever value you want in creation process.

Regarding, onboot=true if you are referring to "Start on boot" option (i am not sure if this is the same as onboot=yes) it only starts the VM when compute node is started.
There is also something like "Start after created" in VM creation process in Proxmox, in a last Confirm Tab. Maybe it would be possible to add this as a checkbox in this plugin ? However, i guess it only applies to create call, I am not sure if it is possible to use this in clone API call.

@pdzionek
Copy link
Author

So I assume you did not like me idea ;)

@tristanrobert
Copy link
Collaborator

No it is fixed in master 0.8.0.

@pdzionek
Copy link
Author

Great, I will test it as soon as it is released with foreman.

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

No branches or pull requests

2 participants