You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cloudstack.apache.org by Luca Gioppo <lu...@csi.it> on 2015/08/06 17:40:33 UTC

detach ISO using kickstart eject command

Does anyone knows if is possible to automatically detach the ISO at the end of
VM instance creation using the kickstart command eject?
I'm installing from a RedHat based ISO.
Thanks
Luca

Re: detach ISO using kickstart eject command

Posted by Daniel Mezentsev <da...@soleks.com>.
  Hi Luca,

I did it via cloudstack API, i don't think that doing eject via kickstart
would be correct approach, cloudstack in such situation has no idea what
happened with ISO. here is example of snippet (in Tcl)

<----cut ---->
package require http
package require base64
package require sha1

set csApiBaseUrl        "<your_url>;
set csApiPath           "/client/api?";
set csApiKey            "<your_api_key>"
set csSecretKey         "<your_secret_key>"

set csVmUuid [ ::http::data [::http::geturl
"http://<virt_router_ip>/latest/meta-data/instance-id"] ]

set csApiCommandList [list]

lappend csApiCommandList "command=detachIso";
lappend csApiCommandList "virtualmachineid=$csVmUuid";
lappend csApiCommandList "apiKey=$csApiKey"

set csApiCommandString [join $csApiCommandList "&"]

set csApiSignature [::base64::encode \
        [::sha1::hmac -bin -key $csSecretKey \
                [join [lsort -ascii [split [string tolower
$csApiCommandString] "&"]] "&"] \
        ] \
]

lappend csApiCommandList [ ::http::formatQuery "signature"
"$csApiSignature" ]

set csApiCommandString [join $csApiCommandList "&"]

set csCommandUrl ${csApiBaseUrl}${csApiPath}${csApiCommandString}

set csApiToken [ ::http::geturl $csCommandUrl ]

<---- cut ---->

> Does anyone knows if is possible to automatically detach the ISO at the
> end of
> VM instance creation using the kickstart command eject?
> I'm installing from a RedHat based ISO.
> ThanksLuca
  Daniel Mezentsev, founder
(+1) 604 313 8592.
Soleks Data Group.
Shaping the clouds.