I don’t think vmware support to resize the disk by decrease the volume size directly. Likely the disk shrink already removed some file systems from OS and cause the OS not able to boot up. 

Thanks and Best Regards,

Thanh.

On 14 Feb 2023, at 15:30, Duy Huynh Đỗ <[email protected]> wrote:


Dear Abhijeet Kasurde,

Thanks a lot for your script, the disk upgrade on vcenter was successful but windows os can't boot again (blue screen) after disk is expanded by script

I am using ansible 2.10.8, vcenter 8
Please help me !

<winboot error.jpg>


Vào lúc 19:15:19 UTC+7 ngày Thứ Tư, 10 tháng 6, 2020, Tony Wong đã viết:
Interested in this too.  I got a windows VM with only C drive. I want to resize from 60GB to 70GB

how do i set up the playbook

On Tue, Jun 9, 2020 at 10:18 PM Abhijeet Kasurde <[email protected]> wrote:
What kind of tasks do you need to run on the OS level? You can either use `vmware_vm_shell` to run command or add that VM as ansible host using `add_host` and run command in subsequent plays.

On Wed, Jun 10, 2020 at 10:44 AM JC JC <[email protected]> wrote:

HI Abhijeet,

 

Thanks a lot for your script, I need one more help that after VM HDD space increased on VM level, we need to perform some task on OS level to see the additional disk space, do you have any ansible script or any help from you.


Cheers
Shiva Shankar S

On Tue, 9 Jun 2020 at 16:36, Abhijeet Kasurde <[email protected]> wrote:
Hi Shiva,

You can do like this -

---
- hosts: localhost
  gather_facts: false
  vars_files:
    - vcenter_vars.yml
  tasks:
  - name: Resize to 10GB from 4GB
    vmware_guest_disk:
      validate_certs: False
      hostname: '{{ vcenter_hostname }}'
      username: '{{ vcenter_username }}'
      password: '{{ vcenter_password }}'
      datacenter: Asia-Datacenter1
      name: vm_8046
      disk:
        - datastore: "ds_171_2"
          scsi_controller: 0
          scsi_type: 'paravirtual'
          size_gb: 10
          state: present
          unit_number: 0

TASK [Resize to 10GB from 4GB] **********************************************************************
task path: /Volumes/data/src/playbooks/vmware/vmware_guest_disk_resize.yml:7
redirecting (type: modules) ansible.builtin.vmware_guest_disk to community.vmware.vmware_guest_disk
changed: [localhost] => {"changed": true, "disk_changes": {"0": "Disk size increased."}, "disk_data": {"0": {"backing_datastore": "ds_171_2", "backing_disk_mode": "persistent", "backing_eagerlyscrub": false, "backing_filename": "[ds_171_2] vm_8046/vm_8046.vmdk", "backing_thinprovisioned": false, "backing_writethrough": false, "capacity_in_bytes": 10737418240, "capacity_in_kb": 10485760, "controller_key": 1000, "iolimit_limit": -1, "iolimit_shares_level": "normal", "iolimit_shares_limit": 1000, "key": 2000, "label": "Hard disk 1", "shares_level": "normal", "shares_limit": 1000, "summary": "10,485,760 KB", "unit_number": 0}}}


If you have multiple disks, you need to gather information about all disk and pass it to vmware_guest_disk before making any changes.

You can take the help of this playbook https://github.com/Akasurde/ansible-reproducers/blob/master/55999/i55999.yml. (This playbook adds a new disk to configuration, but can be modified to resize disk as well)

On Tue, Jun 9, 2020 at 11:48 AM JC JC <[email protected]> wrote:

Hi Team,

 

I'm looking for ansible script to resize my Existing Virtual machine Primary Hard disk (VMDK).

 

Cheers

Shiva Shankar S

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/43fc8a33-8db1-46bb-8875-ca8333c3caeeo%40googlegroups.com.


--
Thanks,
Abhijeet Kasurde

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAFwWkHro90sG79kxBkKsFgG-Bchne0v6q0TnLnEtiOn4_6hGWw%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CANGdo7_U_4sFoY_izPFRwAbWgUEMeYEv8kw4Y8MDo0g%2Bv6-mnw%40mail.gmail.com.


--
Thanks,
Abhijeet Kasurde

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/9dbc509a-eeed-437c-86a9-016d77c3b13en%40googlegroups.com.
<winboot error.jpg>

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/4332072D-6D5E-4573-BCF8-E50E4EAE7D89%40gmail.com.

Reply via email to