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

GPT Types Are Invalid Causing "Unable to create a new partition" Errors #241

Closed
RedTail72 opened this issue May 6, 2021 · 0 comments · Fixed by #242
Closed

GPT Types Are Invalid Causing "Unable to create a new partition" Errors #241

RedTail72 opened this issue May 6, 2021 · 0 comments · Fixed by #242

Comments

@RedTail72
Copy link
Contributor

SUMMARY

When creating a new partition on a GPT disk and passing a gpt_type, the step will error with an "Unable to create a new partition: The specified partition type is not valid." message.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

community.windows.win_partition

ANSIBLE VERSION
ansible 2.9.17
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/var/lib/awx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.6/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.6.8 (default, Aug 24 2020, 17:57:11) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]
CONFIGURATION

OS / ENVIRONMENT

Windows Server 2019 Standard

STEPS TO REPRODUCE

Add a drive or use an existing drive with space for a new partition. Try to create a new partition on that drive and specify the gpt_type parameter.

- name: Create reserved partition
  win_partition:
    partition_size: 128 MiB
    partition_number: 1
    disk_number: 1
    gpt_type: microsoft_reserved
    state: present

EXPECTED RESULTS

A new partition of the specified type is created.

ACTUAL RESULTS

The step errors.

{
  "changed": false,
  "invocation": {
    "module_args": {
      "read_only": null,
      "state": "present",
      "partition_number": 1,
      "offline": null,
      "gpt_type": "microsoft_reserved",
      "hidden": null,
      "partition_size": "128 MiB",
      "drive_letter": null,
      "disk_number": 1,
      "active": null,
      "mbr_type": null
    }
  },
  "msg": "Unable to create a new partition: The specified partition type is not valid.\nActivity ID: {002adbad-2193-0002-b597-2b009321d701}",
  "exception": "The specified partition type is not valid.\nActivity ID: {002adbad-2193-0002-b597-2b009321d701}\r\nAt line:169 char:26\r\n+         $new_partition = New-Partition @parameters\r\n+                          ~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    + CategoryInfo          : InvalidArgument: (StorageWMI:ROOT/Microsoft/Windows/Storage/MSFT_Disk) [New-Partition], CimException\r\n    + FullyQualifiedErrorId : StorageWMI 41010,New-Partition\r\n\r\nScriptStackTrace:\r\n",
  "_ansible_no_log": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant