mirror of
				https://github.com/oSoWoSo/DistroHopper.git
				synced 2024-08-14 22:46:53 +00:00 
			
		
		
		
	Change $disk to $disk_size
This commit is contained in:
		
							parent
							
								
									021e176026
								
							
						
					
					
						commit
						1bce0374f4
					
				
					 2 changed files with 11 additions and 6 deletions
				
			
		|  | @ -280,7 +280,7 @@ Add additional lines to your virtual machine configuration: | ||||||
| 
 | 
 | ||||||
|   * `cpu_cores="4"` - Specify the number of CPU cores allocated to the VM |   * `cpu_cores="4"` - Specify the number of CPU cores allocated to the VM | ||||||
|   * `ram="4G"` - Specify the amount of RAM to allocate to the VM |   * `ram="4G"` - Specify the amount of RAM to allocate to the VM | ||||||
|   * `disk="16G"` - Specify the size of the virtual disk allocated to the VM |   * `disk_size="16G"` - Specify the size of the virtual disk allocated to the VM | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| ## Disk preallocation | ## Disk preallocation | ||||||
|  |  | ||||||
							
								
								
									
										15
									
								
								quickemu
									
										
									
									
									
								
							
							
						
						
									
										15
									
								
								quickemu
									
										
									
									
									
								
							|  | @ -290,7 +290,7 @@ function vm_boot() { | ||||||
|   case ${guest_os} in |   case ${guest_os} in | ||||||
|     linux) |     linux) | ||||||
|       CPU="-cpu host,kvm=on" |       CPU="-cpu host,kvm=on" | ||||||
|       disk="16G" |       disk_size="16G" | ||||||
|       ;; |       ;; | ||||||
|     macos) |     macos) | ||||||
|       #https://www.nicksherlock.com/2020/06/installing-macos-big-sur-on-proxmox/ |       #https://www.nicksherlock.com/2020/06/installing-macos-big-sur-on-proxmox/ | ||||||
|  | @ -345,7 +345,7 @@ function vm_boot() { | ||||||
|     windows) |     windows) | ||||||
|       CPU="-cpu host,kvm=on,+hypervisor,+invtsc,l3-cache=on,migratable=no,hv_frequencies,kvm_pv_unhalt,hv_reenlightenment,hv_relaxed,hv_spinlocks=8191,hv_stimer,hv_synic,hv_time,hv_vapic,hv_vendor_id=1234567890ab,hv_vpindex" |       CPU="-cpu host,kvm=on,+hypervisor,+invtsc,l3-cache=on,migratable=no,hv_frequencies,kvm_pv_unhalt,hv_reenlightenment,hv_relaxed,hv_spinlocks=8191,hv_stimer,hv_synic,hv_time,hv_vapic,hv_vendor_id=1234567890ab,hv_vpindex" | ||||||
|       GUEST_TWEAKS="-no-hpet -global kvm-pit.lost_tick_policy=discard" |       GUEST_TWEAKS="-no-hpet -global kvm-pit.lost_tick_policy=discard" | ||||||
|       disk="64G" |       disk_size="64G" | ||||||
|       ;; |       ;; | ||||||
|     *) |     *) | ||||||
|       CPU="-cpu host,kvm=on" |       CPU="-cpu host,kvm=on" | ||||||
|  | @ -354,7 +354,7 @@ function vm_boot() { | ||||||
|       ;; |       ;; | ||||||
|   esac |   esac | ||||||
| 
 | 
 | ||||||
|   echo " - Disk:     ${disk_img} (${disk})" |   echo " - Disk:     ${disk_img} (${disk_size})" | ||||||
|   if [ ! -f "${disk_img}" ]; then |   if [ ! -f "${disk_img}" ]; then | ||||||
|       # If there is no disk image, create a new image. |       # If there is no disk image, create a new image. | ||||||
|       mkdir -p "${VMDIR}" 2>/dev/null |       mkdir -p "${VMDIR}" 2>/dev/null | ||||||
|  | @ -366,7 +366,7 @@ function vm_boot() { | ||||||
|       esac |       esac | ||||||
| 
 | 
 | ||||||
|       # https://blog.programster.org/qcow2-performance |       # https://blog.programster.org/qcow2-performance | ||||||
|       if ! ${QEMU_IMG} create -q -f qcow2 -o lazy_refcounts=on,preallocation="${preallocation}" "${disk_img}" "${disk}"; then |       if ! ${QEMU_IMG} create -q -f qcow2 -o lazy_refcounts=on,preallocation="${preallocation}" "${disk_img}" "${disk_size}"; then | ||||||
|         echo "ERROR! Failed to create ${disk_img}" |         echo "ERROR! Failed to create ${disk_img}" | ||||||
|         exit 1 |         exit 1 | ||||||
|       fi |       fi | ||||||
|  | @ -732,7 +732,7 @@ function usage() { | ||||||
| boot="efi" | boot="efi" | ||||||
| cpu_cores="" | cpu_cores="" | ||||||
| disk_img="" | disk_img="" | ||||||
| disk="64G" | disk_size="32G" | ||||||
| fixed_iso="" | fixed_iso="" | ||||||
| floppy="" | floppy="" | ||||||
| guest_os="linux" | guest_os="linux" | ||||||
|  | @ -868,6 +868,11 @@ if [ -n "${VM}" ] && [ -e "${VM}" ]; then | ||||||
|   if [ -n "${driver_iso}" ] && [ -z "${fixed_iso}" ]; then |   if [ -n "${driver_iso}" ] && [ -z "${fixed_iso}" ]; then | ||||||
|     fixed_iso="${driver_iso}" |     fixed_iso="${driver_iso}" | ||||||
|   fi |   fi | ||||||
|  | 
 | ||||||
|  |   # Backwards compatibility for ${disk} (size) | ||||||
|  |   if [ -n "${disk}" ]; then | ||||||
|  |     disk_size="${disk}" | ||||||
|  |   fi | ||||||
| else | else | ||||||
|   echo "ERROR! Virtual machine configuration not found." |   echo "ERROR! Virtual machine configuration not found." | ||||||
|   usage |   usage | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue