我正在尝试创建一个虚拟服务器,我对此非常陌生,所以我过度思考这些小东西。
基本上这是我正在使用的信息
这是硬件配置:
姓名:m1 IP:128.0.0.1 mem:16gb num_disk:8 num_cores 10
这就是我所拥有的,我需要帮助才能让它发挥作用。
from urllib2 import Request, urlopen, URLError
name = "10m1" request = Request('http://128.0.0.1/') mem = 16 num_disk
= 8 num_cores = 0 disk_bootable = True
disk_params = params.Disk(name, request, mem, num_disk, num_cores) try:
#add disk to vm here
#print vm added
except Exception as ex:
#print vm failed to add
try:
response = urlopen(request)
answer = response.read()
except URLError, e:
print 'No answer. Got an error code:', e