2017-04-26 38 views
0

今天我試圖用smartos創建一個虛擬機。不支持品牌joyent的供應數據集 - smartos

我建這個配置文件(稱爲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 

任何人有想法? 非常感謝。

回答

1

您在上面的JSON負載上錯過了一個大括號'}',我認爲這只是一個複製/粘貼錯誤。

固定JSON後,我得到如下:

[[email protected] ~]# vmadm validate create -f router.json 
{ 
    "bad_values": [ 
    "image_uuid" 
    ], 
    "bad_properties": [], 
    "missing_properties": [] 
} 

你有導入的圖片了嗎?

[[email protected] ~]# imgadm import 088b97b0-e1a1-11e5-b895-9baa2086eb33 

導入後,我得到:

[[email protected] ~]# vmadm validate create -f router.json 
VALID 'create' payload for joyent brand VMs. 
[[email protected] ~]# vmadm create -f router.json 
Invalid nic tag "stub0" 

當然,我沒有一個etherstub NIC設置呢。

[[email protected] ~]# nictagadm add -l stub0 

然後,我可以用你的有效載荷創建實例:

[[email protected] ~]# vmadm create -f router.json 
Successfully created VM 53c2648c-d963-62b6-a9dd-e0b9809355d0 

如果還是有問題,你可以提供你正在使用的版本?

[[email protected] ~]# uname -a 
SunOS smartos 5.11 joyent_20170413T062226Z i86pc i386 i86pc