I am using Vagrant and Ansible to create a ubuntu vm in parallels pro. I want the hd for the ubuntu vm to be 128gb.
My folder structure is:
Code:
$ tree ubuntu
ubuntu
├── ansible
│ ├── files
│ │ └── config.fish
│ └── playbook.yml
├── main.py
├── pyproject.toml
├── README.md
└── Vagrantfile
3 directories, 6 files
My playbook is
Code:
---
- name: Configure dev_vm
hosts: all
become: true
vars:
username: vagrant
user_home: "/home/{{ username }}"
depot_path: "{{ user_home }}/depot"
fish_config_src: "files/config.fish"
fish_config_dir: "{{ user_home }}/.config/fish"
fish_config_dest: "{{ fish_config_dir }}/config.fish"
tasks:
- name: Update apt cache
apt:
update_cache: yes
cache_valid_time: 3600
- name: Install required packages
apt:
name:
- git
- fish
- cloud-guest-utils
state: present
- name: Ensure depot directory exists
file:
path: "{{ depot_path }}"
state: directory
owner: "{{ username }}"
group: "{{ username }}"
mode: "0755"
- name: Ensure fish config directory exists
file:
path: "{{ fish_config_dir }}"
state: directory
owner: "{{ username }}"
group: "{{ username }}"
mode: "0755"
- name: Copy fish config
copy:
src: "{{ fish_config_src }}"
dest: "{{ fish_config_dest }}"
owner: "{{ username }}"
group: "{{ username }}"
mode: "0644"
- name: Set fish as default shell for user
user:
name: "{{ username }}"
shell: /usr/bin/fish
- name: Grow the root partition
command: growpart /dev/sda 1
changed_when: false
ignore_errors: true
- name: Resize the root filesystem
command: resize2fs /dev/sda1
My Vagrantfile is:
Code:
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-24.04"
config.vm.hostname = "dev-vm"
config.vm.provider "parallels" do |prl|
prl.name = "dev-vm"
prl.memory = 16384
prl.cpus = 6
prl.update_guest_tools = true
prl.linked_clone = false
prl.customize "post-import", ["set", :id, "--device-set", "hdd0", "--size", "131072"]
end
config.vm.provision "ansible" do |ansible|
ansible.playbook = "ansible/playbook.yml"
ansible.compatibility_mode = "2.0"
ansible.verbose = "vvv"
end
end
When I issue the vagrant up command, I get:
Code:
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
==> default: Destroying unused networking interface...
Bringing machine 'default' up with 'parallels' provider...
==> default: Registering VM image from the base box 'bento/ubuntu-24.04'...
==> default: Creating new virtual machine as a full clone of the box image...
==> default: Unregistering the box VM image...
==> default: Setting the default configuration for VM...
==> default: Running 'post-import' VM customizations...
A customization command failed:
["set", :id, "--device-set", "hdd0", "--size", "131072"]
The following error was experienced:
#<VagrantPlugins::Parallels::Errors::ExecutionError:"There was an error while command execution. The command and stderr is shown below.\n\nCommand: [\"/usr/local/bin/prlctl\", \"set\", \"1b9e189f-8dd8-4074-a328-bcaf78b2a1c2\", \"--device-set\", \"hdd0\", \"--size\", \"131072\"]\n\nStderr: Failed to resize: This virtual hard disk cannot be resized because it has one or more snapshots. To resize the disk, delete the snapshots and try again.\nFailed to configure the virtual machine.\n">
Please fix this customization and try again.
What do I need to change to make this work?