<div dir="ltr">I'll share my method of importing images :)<div><br>AWS API provides uploading VHD image (for some reasons using other formats is not working).<div>All what you need is create such image. On top of the Solaris is it quite easy. All what you need is VBox.</div><div>Such method is quite handy because using VboxManage command is possible to create, setup blank VM and boot it in batch mode.</div><div><br></div><div>Below is fragment of my script which could be used as template. It is for install Linux inside but it can be adapted to install any OS (Solaris as well)</div><div><br></div><div><div>--</div><div># <a href="http://www.perkin.org.uk/posts/create-virtualbox-vm-from-the-command-line.html">http://www.perkin.org.uk/posts/create-virtualbox-vm-from-the-command-line.html</a></div><div>VBoxManage setproperty hwvirtexclusive off<br></div><div><br></div><div>VM=$1</div><div>MAC_ADDR="$2"</div><div><br></div><div>echo "Unregister $VM"</div><div>VBoxManage unregistervm $VM \</div><div><span style="white-space:pre">     </span>--delete</div><div>rm -rf $VM.vhd</div><div><br></div><div>echo "Create $VM.vhd image"</div><div>VBoxManage createmedium disk \</div><div><span style="white-space:pre">       </span>--size 5120 \</div><div><span style="white-space:pre"> </span>--format VHD \</div><div><span style="white-space:pre">        </span>--filename $VM.vhd</div><div><br></div><div>echo "Register $VM.vmdk image as Linux_64 VM" </div><div>VBoxManage createvm \</div><div><span style="white-space:pre">       </span>--name $VM \</div><div><span style="white-space:pre">  </span>--ostype "Linux_64" \</div><div><span style="white-space:pre">       </span>--register</div><div><br></div><div>echo "Add SATA controller to $VM"</div><div>VBoxManage storagectl $VM \</div><div><span style="white-space:pre">       </span>--name "SATA Controller" \</div><div><span style="white-space:pre">  </span>--add sata \</div><div><span style="white-space:pre">  </span>--controller IntelAHCI</div><div><br></div><div>VBoxManage storageattach $VM \</div><div><span style="white-space:pre">  </span>--storagectl "SATA Controller" \</div><div><span style="white-space:pre">    </span>--port 0 \</div><div><span style="white-space:pre">    </span>--device 0 \</div><div><span style="white-space:pre">  </span>--type hdd \</div><div><span style="white-space:pre">  </span>--medium $VM.vhd</div><div><br></div><div>echo "Add APIC"</div><div>VBoxManage modifyvm $VM --ioapic on</div><div><br></div><div>echo "Add boot sequence order"</div><div>VBoxManage modifyvm $VM --boot1 net --boot2 disk</div><div><br></div><div>echo "Add RAM, VRAM and enable RDP access"</div><div>VBoxManage modifyvm $VM \</div><div><span style="white-space:pre">        </span>--memory 4096 \</div><div><span style="white-space:pre">       </span>--vram 128 \</div><div><span style="white-space:pre">  </span>--vrde on</div><div><br></div><div>echo "Create $VM0 VNIC with exact MAC: $MAC_ADDR"</div><div>dladm create-vnic -l aggr0 -m $MAC_ADDR $VM0</div><div><br></div><div>echo "Network card"</div><div>VBoxManage modifyvm $VM \</div><div><span style="white-space:pre">  </span>--nic1 bridged \</div><div><span style="white-space:pre">      </span>--bridgeadapter1 $VM0 \</div><div><span style="white-space:pre">       </span>--macaddress1 080027f3399d</div><div><br></div><div>VBoxHeadless -startvm $VM</div><div><br></div><div>echo "Delete VM0 VNIC"</div><div>dladm delete-vnic $VM0</div><div><br></div><div>echo "Unregister $VM"</div><div>VBoxManage unregistervm $VM</div><div>mv $VM.vhd ready</div><div><br></div><div>ec2-import-instance $VM.vhd –f VHD -t m3.xlarge -a x86_64 -b myawsbucket -o AKIAIOSFODNN7EXAMPLE –w wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -p Linux</div></div><div>-- </div><div><br></div><div>If kickstart file or AI manifest at the end of installation will be powering off VM "VBoxHeadless -startvm $VM" command will be able to finish and next steps can be done in batch mode like uploading just generated image to VMware, OVM, Azure or AWS.</div><div>BTW ec2-import-instance command: this command is a bit odd because you need to pass two keys. First one is account key and second one is AWS bucket key (even if AWS account has RW access to bucket).</div><div><a href="http://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html#upload-image">http://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html#upload-image</a></div><div><br></div><div>Real advantage of using this method is sharing the same Linux KS or Solaris AI manifest/profile (or even Windows install profiles) with bare metal installation descriptions in form of native install descriptions.</div><div>Knowing exact MAC address of the VM used to create exact image is possible on install server side associate those MAC addresses with KS or AI files.</div><div><br></div><div>So .. you don't need to sit down upside down on you chair or use ISO images :)</div><div>All what is needed is possible to do in batch mode and/or using regular/native OS install services.</div><div><br></div><div>kloczek</div></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Tomasz Kłoczko | Tel: 0774 1209067 | LinkedIn: <b style="font-weight:normal"><a href="http://lnkd.in/FXPWxH" style="text-decoration:none" target="_blank"><span style="font-size:13px;font-family:Arial;color:rgb(17,85,204);background-color:transparent;text-decoration:underline;vertical-align:baseline;white-space:pre-wrap">http://lnkd.in/FXPWxH</span></a></b></div></div></div>
<br><div class="gmail_quote">On 31 July 2017 at 21:51, Al Slater <span dir="ltr"><<a href="mailto:al.slater@scluk.com" target="_blank">al.slater@scluk.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 31/07/17 21:30, Eric Sproul wrote:<br>
> On Mon, Jul 31, 2017 at 4:05 PM, Al Slater <<a href="mailto:al.slater@scluk.com">al.slater@scluk.com</a>> wrote:<br>
>> One more question though, is there any way to enable an SMF service for<br>
>> the next reboot, but not immediately.  Specifically, I want to enable<br>
>> the initial-boot service with a .initialboot file in place, then create<br>
>> a new AMI.<br>
>><br>
>> I wist to use .initialboot to grab the instance configuration from<br>
>> amazon (hostname, root keys etc) and configure appropriately when the<br>
>> new instance starts.<br>
><br>
> Hi Al,<br>
> The initial-boot service isn't really suitable for this sort of thing.<br>
> You might want to check out<br>
> pkg://omnios/system/<wbr>management/ec2-credential which specifically<br>
> handles setting up the credentials at first boot.  That could be<br>
> trivially extended[1] to set the system hostname and probably any<br>
> other "standard" thing that operators want.<br>
><br>
> Eric<br>
><br>
> [1] <a href="https://github.com/omniosorg/omnios-build/blob/master/build/ec2-credential/files/install-ec2-credential" rel="noreferrer" target="_blank">https://github.com/omniosorg/<wbr>omnios-build/blob/master/<wbr>build/ec2-credential/files/<wbr>install-ec2-credential</a><br>
<br>
</span>Thanks for the pointer Eric.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Al Slater<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
______________________________<wbr>_________________<br>
OmniOS-discuss mailing list<br>
<a href="mailto:OmniOS-discuss@lists.omniti.com">OmniOS-discuss@lists.omniti.<wbr>com</a><br>
<a href="http://lists.omniti.com/mailman/listinfo/omnios-discuss" rel="noreferrer" target="_blank">http://lists.omniti.com/<wbr>mailman/listinfo/omnios-<wbr>discuss</a><br>
</div></div></blockquote></div><br></div>