TritonDataCenter / smartos-live

For more information, please see http://smartos.org/ For any questions that aren't answered there, please join the SmartOS discussion list: https://smartos.topicbox.com/groups/smartos-discuss
1.57k stars 246 forks source link

vmadm should support ahci cdrom #944

Closed ally2050 closed 4 years ago

ally2050 commented 4 years ago

uname -a

SunOS bkhost 5.11 joyent_20200603T203505Z i86pc i386 i86pc

Step 1. Create my VM: { "autoboot": false, "alias": "Win2012", "hostname": "Win2012", "vnc_port": 5922, "brand": "bhyve", "bootrom": "uefi", "ram": "4096", "vcpus": "2", "nics": [ { "nic_tag": "admin", "ip": "192.168.1.22", "netmask": "255.255.255.0", "model": "virtio", "primary": true } ], "disks": [ { "size": 131072, "boot": true, "model": "virtio" } ] }

Step 2. start my VM (faild to boot from cdrom, no cdrom under uefi):

vmadm start $UUID order=cd,once=d cdrom=/w2012_virtio.iso,ide

Step 3. add cdrom within VM ( this way works fine):

cat /opt/add_cdrom.json

{ "add_disks": [ { "path": "/w2012_virtio.iso", "media": "cdrom", "model": "ahci" } ] }

vmadm update $UUID -f /opt/add_cdrom.json

vmadm start $UUID

Result: uefi + ide cdrom in step 2 failed, uefi + ahci cdrom in step 3 works. vmadm cdrom support ide,scsi,virtio, but not ahci.

jasonbking commented 4 years ago

The 'order=XX' and 'cdrom=...' options are only supported with KVM. For bhyve you must explicitly add the cdrom device as you discovered.

ally2050 commented 4 years ago

Thanks for so quickly a reply. then it's a misuse of vmadm.