Ask Your Question

sameer's profile - activity

2016-12-13 13:52:57 -0600 received badge  Nice Answer (source)
2016-01-20 10:33:02 -0600 received badge  Great Question (source)
2015-07-19 03:01:37 -0600 received badge  Good Question (source)
2015-06-17 08:26:57 -0600 received badge  Nice Question (source)
2014-12-12 03:18:06 -0600 received badge  Famous Question (source)
2014-10-02 22:46:30 -0600 received badge  Student (source)
2014-07-26 17:34:13 -0600 received badge  Famous Question (source)
2014-07-26 17:34:13 -0600 received badge  Popular Question (source)
2014-07-26 17:34:13 -0600 received badge  Notable Question (source)
2014-07-01 05:28:10 -0600 received badge  Self-Learner (source)
2014-07-01 05:28:10 -0600 received badge  Teacher (source)
2014-07-01 05:27:06 -0600 received badge  Notable Question (source)
2014-06-17 00:04:15 -0600 received badge  Popular Question (source)
2014-06-16 20:45:33 -0600 answered a question nova get-password

Answering my own question. The script below explains it.

https://gist.github.com/vishvananda/4008762 (https://gist.github.com/vishvananda/4...)

#!/usr/bin/env bash
SSH_KEYFILE=`tempfile`
SSL_KEYFILE=`tempfile`
if ! curl -s -f http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key > $SSH_KEYFILE; then
  echo  "Failed to get key"
fi
cat $SSH_KEYFILE
PASSWORD=`openssl rand -base64 48 | tr -d '/+' | cut -c1-16`
sudo usermod ubuntu -p `openssl passwd -1 $PASSWORD`

ssh-keygen -e -f $SSH_KEYFILE -m PKCS8 > $SSL_KEYFILE
ENCRYPTED=`echo "$PASSWORD" | openssl rsautl -encrypt -pubin -inkey $SSL_KEYFILE -keyform PEM | openssl base64 -e -A`
echo $'\n'"ENCRYPTED_PASSWORD:$ENCRYPTED" | sudo tee /dev/console
curl -X POST http://169.254.169.254/openstack/2013-04-04/password -d $ENCRYPTED || true
rm $SSH_KEYFILE $SSL_KEYFILE
# get the script
# curl -sOL https://raw.github.com/gist/4008762/getpass.sh
# add keypair
# nova add-key --pub-key .ssh/id_rsa.pub mykey
# boot instance
# nova boot --flavor <flavor-id> --image <image-uuid> --key-name mykey --user-data getpass.sh test
# Get the password on the client side:
# nova get-password test .ssh/id_rsa
# Or with an older nova install:
# nova console-log test | grep 'ENCRYPTED_PASSWORD' | cut -d':' -f2 | tail -n 1 | openssl base64 -d -A | openssl rsautl -decrypt -inkey .ssh/id_rsa
2014-06-16 04:13:49 -0600 asked a question nova get-password

Suppose I want to do my own image customization (no cloud-init), including generating a password and posting it to the metadata password url. How do I encrypt it with the public key obtained from the instance metadata such that 'nova get-password' can decrypt it.

Thanks,

2014-06-14 19:38:16 -0600 received badge  Scholar (source)
2014-06-14 19:38:13 -0600 commented answer horizon session timeout

That explains it then! Because I did set session_timeout to a large number yet the session was expiring. Must be the token expiry you mentioned. Thanks.

2014-06-13 19:54:17 -0600 received badge  Editor (source)
2014-06-13 19:53:13 -0600 asked a question horizon session timeout

Is there a way to disable horizon's session timeout completely? I'm running a dev/test openstack IceHouse on Ubuntu trusty 14.04 Thanks,

2014-06-08 09:24:18 -0600 commented answer Ubuntu 14.04 cloud image won't boot

Thanks! This was indeed my issue. The metadata-agent on neutron was configured with the wrong region name. Once fixed my Ubuntu was able to finish booting (cloud-tools completed). I would've marked this as an answer but I'm not the OP :-)

2014-06-07 05:40:47 -0600 commented answer Ubuntu 14.04 cloud image won't boot

These do not seem to be about the same issue. In my case the instance spawns successfully even though it fails to resize.

2014-06-07 04:15:03 -0600 commented question Ubuntu 14.04 cloud image won't boot

I have the same problem. If I turn on debugging in nova-compute.conf I see the following:

2014-06-07 19:07:59.342 13686 DEBUG nova.virt.disk.api [req-609cce86-413a-483f-a522-a91b2c424bec e03818df7adc4763b143e93e34819b0f 8ca3061f56ad4dd593094826c0a7cdbc] Unable to mount image /var/lib/nova/instances/69e58818-956c-40d3-8ee3-2d460dd51e3b/disk with error Error mounting /var/lib/nova/instances/69e58818-956c-40d3-8ee3-2d460dd51e3b/disk with libguestfs (/usr/bin/supermin-helper exited with error status 1.
See http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs). Cannot resize. is_image_partitionless /usr/lib/python2.7/dist-packages/nova/virt/disk/api.py:211