今天,我将尝试使用smartos创建一个VM。
我构建了这个配置文件(名为router.json):
{
"alias": "router",
"hostname": "router",
"brand": "joyent",
"max_physical_memory": 256,
"image_uuid": "088b97b0-e1a1-11e5-b895-9baa2086eb33",
"quota": 10,
"nics": [
{
"nic_tag": "admin",
"ip": "dhcp",
"allow_ip_spoofing": "1",
"primary": "1"
},
{
"nic_tag": "stub0",
"ip": "10.0.0.1",
"netmask": "255.255.255.0",
"allow_ip_spoofing": "1",
"gateway": "10.0.0.1"
}
]运行以下命令:
# vmadm validate create -f router.json
VALID 'create' payload for joyent brand VMs.但是当我尝试创建VM时,我仍然有一个错误:
# vmadm create -f router.json
provisioning dataset 088b97b0-e1a1-11e5-b895-9baa2086eb33 with brand joyent is not supported有谁有主意吗?非常感谢。
发布于 2017-04-28 01:49:37
您在上面的JSON有效负载中缺少右大括号'}‘,我认为这只是一个复制/粘贴错误。
修复JSON之后,我得到了以下内容:
[root@smartos ~]# vmadm validate create -f router.json
{
"bad_values": [
"image_uuid"
],
"bad_properties": [],
"missing_properties": []
}你已经导入了那个图像了吗?
[root@smartos ~]# imgadm import 088b97b0-e1a1-11e5-b895-9baa2086eb33导入后,我得到:
[root@smartos ~]# vmadm validate create -f router.json
VALID 'create' payload for joyent brand VMs.
[root@smartos ~]# vmadm create -f router.json
Invalid nic tag "stub0"当然,我还没有安装etherstub NIC。
[root@smartos ~]# nictagadm add -l stub0然后我就可以用你的负载创建实例了:
[root@smartos ~]# vmadm create -f router.json
Successfully created VM 53c2648c-d963-62b6-a9dd-e0b9809355d0如果你仍然有问题,你能提供你正在使用的版本吗?
[root@smartos ~]# uname -a
SunOS smartos 5.11 joyent_20170413T062226Z i86pc i386 i86pchttps://stackoverflow.com/questions/43639956
复制相似问题