解决了

AOS 5.10.9.1 LTS-使用PE,ACLI和REST API从URL创建图像的错误


Userlevel 1
徽章 +2

大家好

我正在尝试从HTTP服务器创建一个磁盘映像(我知道NFS是首选),但是我从PE,ACLI和REST API出现了错误。

AHV,CVM,PE,PC和Web服务器是同一网络的一个(然后我可以排除路由问题),并且在Web服务器(CentOS 7.7,Apache HTTPD-2.4.6-90)上,防火墙和SELINUX被禁用并且URL称为使用IP来避免DNS问题。

该内容可通过WGET获得,但图像创建命令以错误503(服务不可用)结束,而在Web服务器上具有log处于DEBUG级别的log,则在错误和访问日志上没有写任何内容。

我还测试过以停止HTTPD并使用Python -M SimpleHttpserver 80,但没有工作(我得到了一个无法完全阅读的Exctuct,我不知道在哪里记录了)

怎么了?
我缺少什么?

有人有建议吗?

这里有一些操作样本:

使用WGET下载测试以检查HTTP服务

~~~

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
连接到192.168.158.40:80 ...连接。
http请求发送,等待响应... 200可以
长度:1605894144(1.5G)
保存到:“ gm-back-test-001-scsi1.qcow2’

100%[===================================================================================================================>] 1,605,894,144 275mb/s 6.0s

~~~

使用ACLI的图像创建测试

~~~

nutanix@cmv:acli image.create“ gm-back-test-001-scsi1a” image_type = kdiskimage source_url = http://192.168.158.40/images/images/gm-back-test-test-001-scsi1.qcow2 contuner = osimages
GM-Back-Test-001-SCSI1A:待处理
GM-BACK-TEST-001-SCSI1A:UPLOADFAILURE:无法访问URL http://192.168.158.40/images/gm-back-test-001-scsi1.qcow2:请求的URL返回e [...]
----- GM-Back-test-001-SCSI1A -----------------------
uploadFailure:无法访问URL http://192.168.158.40/images/gm-back-test-001-scsi1.qcow2:请求的URL返回错误:503服务不可用

~~~

使用REST API资源管理器测试

~~~

curl -x post -header'content -type:application/json'-header'accept:application/json'-d'{
“注释”:“ http创建的图像”,
“ 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”,
“名称”:“ GM-Back-test-001-SCSI1A”
}
''https:// pe-ip:9440/prismgateway/services/rest/v2.0/images/'

~~~

来自PE的测试。开始但两分钟后失败…

来自Nutanix文档:

图像来源:执行以下操作之一:

  • 单击来自URL广播按钮以从Internet导入图像。使用以下语法在字段中输入适当的URL地址:NFS或HTTP:
    nfs:// [主机名| ip_addr]/路径http:// [hostName | ip_addr]/path

ACLI图像创建参考

https://portal.nutanix.com/page/documents/details/?targetId=command-ref-aos-v510:acl-acli-image-auto-r.html

创建图像
可选地,如果我们要从源_url创建图像以验证图像的正确性,也可以指定校验和。

image.create名称[Annotation =“ Annotation”] [Architution =“ Architection”] [Clone_from_vmdisk =“ clone_from_vmdisk”]{RAW | VHD | VMDK | VDI | ISO | QCOW2 | VHDX}””] [wait =“ {true | false}”]

图标

最好的答案皮耶罗2020年3月18日,09:11

Hi all,<\/p>

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...<\/p>

I tested two solutions:

- Removal of http check box (I don\u00b4t 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
\u00a0<\/p>","className":"post__content__best_answer"}">

查看原件

该主题已关闭以供评论

2个答复

Userlevel 1
徽章 +2

大家好,

我找到了问题!

在Prims Element代理配置中,HTTP和HTTPS复选框都标记了,所有HTTP通信都重定向到代理...

我测试了两种解决方案:

- 删除HTTP复选框(我不认为群集内需要任何HTTP通信)
- 将HTTP存储空间添加到代理白名单中。

两种解决方案都在起作用,现在我可以以光速以光源为源创建PE/ACLI/REST API的图像。

玩得开心
-piero

UserLevel 6
徽章 +5

嗨,皮耶罗,谢谢您分享解决方案!

Learn more about our cookies.<\/a>","cookiepolicy.button":"Accept cookies","cookiepolicy.button.deny":"Deny all","cookiepolicy.link":"Cookie settings","cookiepolicy.modal.title":"Cookie settings","cookiepolicy.modal.content":"We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.<\/a>","cookiepolicy.modal.level1":"Basic
Functional","cookiepolicy.modal.level2":"Normal
Functional + analytics","cookiepolicy.modal.level3":"Complete
Functional + analytics + social media + embedded videos"}}}">
Baidu