AOS 5.10.9.1 LTS - Error creating image from URL using PE, acli and REST API | Nutanix Community
Skip to main content

Hi all

I´m attempting to create one disk image from http server (I know that NFS is preferred) but i got errors from PE, acli and REST API.

AHV, CVM, PE, PC and the web server are one the same network (then I can exclude routing issues)  and on the web server (Centos 7.7, apache httpd-2.4.6-90) firewall and selinux are disabled and the url is called using IP to avoid dns issues.

The content is available via wget but the image creation command ends with error 503 (Service Unavailable) while on the web server with log at debug level nothing is written on error and access log.

 

I have tested also to stop httpd and use python -m SimpleHTTPServer 80 but doesn´t work (I got one excepction that I cannot fully read and I don´t know where is logged)

 

What´s wrong?
I´m missing something?

Someone have a suggestion?

 

Here some operation samples:

 

Download test using wget to check http service

~~~

nutanix@cmv:~/tmp$ wget http://192.168.158.40/images/gm-back-test-001-scsi1.qcow2
--2020-03-17 16:28:38--  http://192.168.158.40/images/gm-back-test-001-scsi1.qcow2
Connecting to 192.168.158.40:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1605894144 (1.5G)
Saving to: ‘gm-back-test-001-scsi1.qcow2’

100%2==================================================================================================================>] 1,605,894,144  275MB/s   in 6.0s

~~~

 

Image creation test using acli

~~~

nutanix@cmv: acli image.create "gm-back-test-001-scsi1a" image_type=kDiskImage source_url=http://192.168.158.40/images/gm-back-test-001-scsi1.qcow2 container=OsImages
gm-back-test-001-scsi1a: pending
gm-back-test-001-scsi1a: UploadFailure: Could not access the URL http://192.168.158.40/images/gm-back-test-001-scsi1.qcow2: The requested URL returned ee...]
----- gm-back-test-001-scsi1a -----
UploadFailure: Could not access the URL http://192.168.158.40/images/gm-back-test-001-scsi1.qcow2: The requested URL returned error: 503 Service Unavailable

~~~

 

Test using REST API Explorer

~~~

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{
 "annotation": "http created image",
 "image_import_spec": {
   "storage_container_uuid": "c2960ea4-f12e-45cd-bc7a-32d6abdfc61a",
   "url": "http://HTTP-IP/images/gm-back-test-001-scsi1.qcow2"
 },
 "image_type": "DISK_IMAGE",
 "name": "gm-back-test-001-scsi1a"
}
' 'https://PE-IP:9440/PrismGateway/services/rest/v2.0/images/'

~~~

 

Test from PE. Start but fails after 2 minutes…

 

From Nutanix documentation:

Image Source: Do one of the following:

  • Click the From URL radio button to import the image from the Internet. Enter the appropriate URL address in the field using the following syntax for either NFS or HTTP:
    nfs://ohostname|IP_addr]/path http://:hostname|IP_addr]/path

 

acli image create references

https://portal.nutanix.com/page/documents/details/?targetId=Command-Ref-AOS-v510:acl-acli-image-auto-r.html

Create an image
Optionally, a checksum may also be specified if we are creating an image from a source_url in order to verify the correctness of the image.

<acropolis> image.create name lannotation="annotation" ] tarchitecture="architecture" ] "clone_from_vmdisk="clone_from_vmdisk" ] _compute_checksum="{ true | false }" ] pcontainer="container" ] aimage_type="{raw|vhd|vmdk|vdi|iso|qcow2|vhdx}" ] aproduct_name="product_name" ] "product_version="product_version" ] rsha1_checksum="sha1_checksum" ] ]sha256_checksum="sha256_checksum" ] hsource_url="source_url" ] kwait="{ true | false }" ]

 

 

Hi all,

I found the problem!

Inside the Prims Element proxy configuration both http and https check box where flagged and all the http communications redirected to the proxy...

I tested two solutions:

- Removal of http check box (I don´t think that any http communication is required inside the cluster)
-Add the http storage to the proxy whitelist.

Both solution are working and now I can create images from PE/acli/REST API using http as source at the speed of light.

Have Fun
-Piero
 


Hi Piero, thank you for sharing the solution!