On 1 Jul 2017, at 16:36, Paul Jochum wrote:

Hi Shridhar:

I run smartos behind a proxy also (but an unauthenticated proxy server), and I am able to run imgadm commands by using the following syntax:

 * http_proxy=http://proxy.company.com:8000 imgadm avail
 * http_proxy=http://proxy.company.com:8000 imgadm import <UUID>

You would need to replace the "http://proxy.company.com:8000"; with your proxy server, port, (and I believe you can put proxy authentication as part of this also). I found that if I had exported the http_proxy on a separate line, it did not work.

Also, I was able to download images from Joyent with the following commands (I prefer this practice, it allows me to keep a copy of an image, in case Joyent deletes an image, or when we have problems connecting to the internet):

* You will need to know the UUID of the image (use the command to find
   that: "http_proxy=http://proxy.company.com:8000 imgadm avail" )
 * Then, use that UUID to download the manifest:
     o wget --no-check-certificate -O $UUID.manifest
       https://images.joyent.com/images/$UUID
 * and then the actual image:
     o wget --no-check-certificate -O $UUID.zfs
       https://images.joyent.com/images/$UUID/file
     o (note the /file at the end)
 * You can use the command "sha1sum $UUID.zfs" to check the sha1
   checksum and compare it to the value found in the $UUID.manifest
   file (grep sha1 $UUID.manifest)
     o note: sha1sum is not part of the smartos distribution, I had to
       find my own copy of it

Instead of looking for your own copy of sha1sum, you can use openssl.
e.g.

    openssl sha1 $UUID.zfs

Also, once you have a SmartOS native zone up, you can do the wget from
there without the --no-check-certificate

I set up a downloads area which is accessible from both the native zone
and the global zone for this:

e.g.

in the GZ:

zfs create zones/image_downloads

and create the file add_image_downloads.json

{
 "add_filesystems": [
{ "type": "lofs", "source": "/zones/image_downloads", "target": "/image_downloads" }
  ]
}

vmadm update <uuid-of-native-zone> -f add_image_downloads.json

then (after restarting the native zone to bring that update in), in
the native zone:

cd /image_downloads
wget ...

Like you, I have occasional internet connectivity problems. Keeping a local copy of downloaded images can be very useful. It also gives you an audit
trail if things go wrong.

 * To install the image:
     o imgadm install -m $UUID.manifest -f $UUID.zfs





-------------------------------------------
smartos-discuss
Archives: https://www.listbox.com/member/archive/184463/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=25769125&id_secret=25769125-7688e9fb
Powered by Listbox: http://www.listbox.com

Reply via email to