Closed Znuff closed 7 years ago
Almost there ;)
$ proxmox-deploy --proxmox-host proxmox.lan --cloud-images-dir ~/cloud-init
proxmox-deploy version 0.3 (build 7b45fa9) starting...
Asking user for configuration input
Storage to create disk on (Enter ? for a list of options) [vm-400g]: ?
Please enter one of:
backup-2tb-vms
vm-400g
Storage to create disk on (Enter ? for a list of options) [vm-400g]: backup-2tb-vms
Amount of CPUs: 1
Emulate which CPU family (Enter ? for a list of options) [host]:
Amount of Memory (MB): 1024
Size of disk (GB): 32
Virtual Machine id [100]:
Hostname (a FQDN is recommended): test.lan
What Cloud image to upload (Enter ? for a list of options) [/home/morph/cloud-init/xenial-server-cloudimg-amd64-disk1.img]:
Locale (Enter ? for a list of options) [en_US.UTF-8]:
Timezone (Enter ? for a list of options) [Europe/Amsterdam]: Europe/Berlin
Keyboard layout (Enter ? for a list of options) [us]: de
SSH Public key for root user [2 entries]: ssh-rsa ...
Enter another value, or empty to continue:
Run apt-get update after rollout [Yes]:
Run apt-get upgrade after rollout [No]: Yes
Bootstrap with Chef [No]:
Configure networking [Yes]:
VLAN ID (Specify a value, or 'empty') [1]:
Network device to configure [eth0]:
Network type (Enter ? for a list of options) [dhcp]:
Resize root filesystem [Yes]:
Install extra packages (space separated)) []: vim bash-completion
Run commands after cloud init (space separated) []:
Reboot after cloud-init [No]:
Start VM after provisioning [No]: Yes
Starting provisioning process
Creating Virtual Machine
Generating cloud-init seed files at /tmp/cloudinit-seed-isoQz55h8
Generating cloud-init seed ISO at /tmp/cloudinit-seed-iso-ZxFi8Z.iso
Removing cloud-init temp files
Uploading cloud-init seed ISO to Proxmox
Uploading to LVM or ZFS storage
Transferring image to Proxmox
Traceback (most recent call last):
File "/home/morph/proxmoxer/bin/proxmox-deploy", line 11, in <module>
sys.exit(main())
File "/home/morph/proxmoxer/local/lib/python2.7/site-packages/proxmoxdeploy/cli.py", line 122, in main
vmid=proxmox['vmid'], iso_file=cloudinit_iso)
File "/home/morph/proxmoxer/local/lib/python2.7/site-packages/proxmoxdeploy/proxmox.py", line 540, in attach_seed_iso
disk_label="cloudinit-seed", disk_format="raw")
File "/home/morph/proxmoxer/local/lib/python2.7/site-packages/proxmoxdeploy/proxmox.py", line 516, in upload
disk_size=disk_size)
File "/home/morph/proxmoxer/local/lib/python2.7/site-packages/proxmoxdeploy/proxmox.py", line 473, in _upload_to_lvm_storage
disk_size=disk_size)
File "/home/morph/proxmoxer/local/lib/python2.7/site-packages/proxmoxdeploy/proxmox.py", line 394, in _upload_to_storage
if tmpfile:
UnboundLocalError: local variable 'tmpfile' referenced before assignment
root@proxmox:~# qm config 100
cores: 1
cpu: host
memory: 1024
name: test.lan
net0: virtio=9E:82:0B:F5:E7:D1,bridge=vmbr0,tag=1
smbios1: uuid=704dcfb8-76f8-48fc-80a7-260b1aef2875
sockets: 1
That's not an issue with the pull/patch;
I experienced the same thing. Apparently the master or devel branches on github don't work. With or without the patch, you will run into the same issue.
I eventually ended up just patching the file that pip install downloads.
The UnboundLocalError is fixed on develop, you can rebase your branch.
I'm not opposed to the contents of this patch. However, implementation details are leaking from the ZFS changes to the other storage types.
You should create a separate _upload_to_zfspool_storage method which implement the specific changes required for ZFS, like setting the minimum disk size and ZFS specific log messages.
Also: can you find a reference for me that the minimum size in ZFS is 1024 bytes, or is this a detail that is specific to your ZFS install and can be different for other users?
It's not 1024, I worded it badly.
The error I encountered when creating the disk was volume size must be a multiple of volume block size
.
You can get the volume block size with zfs get volblocksize
. I just picked 1024 to test and I stuck with it. You just need to make sure it's always a multiple.
Proxmox's ZFS plugin always seems to create volumes with 8K block size (tough I can't confirm it).
are there any ongoing errors with this PR? trying to use proxmox-deploy with my zfs based server and can't :/
@Znuff : I have taken your changes and reimplemented them in #19 . Thanks for the pointers!
zfspool storage type is just like lvm, only workaround needed is to have the provisioning image be at least 1MB in size.