nutanix.ansible icon indicating copy to clipboard operation
nutanix.ansible copied to clipboard

ntnx_images: uploaded image size shows empty in Prism central

Open sivaxsan opened this issue 1 year ago • 15 comments

Describe the bug Uploaded image from local workstation size shows empty in prism central ; but if I upload the image via prism central GUI - it shows correct image size.

Note: Image has been created via redhat image builder

To Reproduce Steps to reproduce the behavior:

  • name: Get Image hosts: localhost gather_facts: no module_defaults: group/nutanix.ncp.ntnx: nutanix_host: "{{ cluster_url }}" nutanix_username: "{{ prism_user }}" nutanix_password: "{{ prism_password }}" vars_files: nutanix_vars.yml tasks:
    • name: List images using name filter criteria nutanix.ncp.ntnx_images: state: "present" source_path: "/var/tmp/7f7bfb3a-6775-4e5a-b5f2-cc648ad77e77-disk.qcow2" validate_certs: False clusters: - name: "******" categories: AppFamily: - Backup name: "rhel_8_test_4" desc: "description" image_type: "DISK_IMAGE" wait: true register: result

    • name: print value debug: msg: '{{ result }}'

Stack trace

Expected behavior A clear and concise description of what you expected to happen. image upload with correct image size .

Additional context Add any other context about the problem here.

sivaxsan avatar Apr 14 '23 09:04 sivaxsan

tried alternate option for source.

using source_uri:
but getting fatal: [localhost]: FAILED! => { "changed": false,

sivaxsan avatar Apr 14 '23 15:04 sivaxsan

my code:

  • name: List images using name filter criteria nutanix.ncp.ntnx_images: state: "present" source_uri: "https://********/build/RedHat/8/images/rhel-8.7-x86_64-kvm.qcow2" validate_certs: false name: "rhel_8_test_4" desc: "description" image_type: "DISK_IMAGE" wait: true register: result

sivaxsan avatar Apr 14 '23 15:04 sivaxsan

as I declared validate_certs is false, not sure, why still it looking for peer's certificate.

sivaxsan avatar Apr 14 '23 15:04 sivaxsan

hi @sivaxsan, can you share Prism Central and Nutanix Ansible version you are using ? I can check.

bhati-pradeep avatar Apr 24 '23 03:04 bhati-pradeep

Hi ,

Ansible version is : core 2.13.5 Prism Central version is : 2022.6 NCC version: 4.6.0.1 LCM version : 2.6.0.1

Note: If I use REST API - upload image size shows correct size.

Thanks Siva

sivaxsan avatar Apr 24 '23 08:04 sivaxsan

Hi @sivaxsan, Can you share response of playbook task once task finishes. You can mask sensitive details. I tried in my local and it works fine for me. Wanted to check size attribute in response. Thanks.

bhati-pradeep avatar Apr 27 '23 10:04 bhati-pradeep

Also if size never comes in the UI or it comes after some time ?

bhati-pradeep avatar Apr 27 '23 10:04 bhati-pradeep

Image size never comes shows in the UI. I couldn't use public github in my office laptop. so, it is difficult to update the logs. Also, playbook doesn't shows any errors and it completed successfully.

As I observed, couldn't see any issues , if I use RESTAPI and able to see the image size and use it for OS build.

nutanix.ncp.ntnx_images: : plays shows successful, but doesn't show image size and couldn't able to use it for OS build.

sivaxsan avatar Apr 27 '23 10:04 sivaxsan

Are you able to create VM from image ?

bhati-pradeep avatar Apr 27 '23 11:04 bhati-pradeep

If you can print result of task. Check you check response.status.resources.size_bytes is set or not.

bhati-pradeep avatar Apr 27 '23 11:04 bhati-pradeep

Hi, response.status.resources shows only below options:

resources: { architecture: x86_84 image_type: DISK IMAGE } state : Complete

I couldn't see size_bytes in the output

sivaxsan avatar Apr 27 '23 13:04 sivaxsan

hi @sivaxsan, Can you create nutanix support ticket ? This will need a call for for more debugging.

bhati-pradeep avatar Apr 27 '23 15:04 bhati-pradeep

I already raised a case with Nutanix, they advised to raise a issue in nutanix.ansible git repo. Nutanix case: 01435754 [As they mentioned : Issue relates open source project actively maintained by Nutanix, and will get support directly from github

sivaxsan avatar Apr 27 '23 16:04 sivaxsan

Okay. Let me get back to you with more details and will try to reproduce on my local setup as well.

bhati-pradeep avatar Apr 27 '23 16:04 bhati-pradeep

@sivaxsan Are you still facing this issue ? Its still non reproducible in my local.

bhati-pradeep avatar Nov 09 '23 18:11 bhati-pradeep