Ask Your Question

Daniel Ramos's profile - activity

2016-09-27 14:06:55 -0500 received badge  Famous Question (source)
2016-09-04 04:42:33 -0500 received badge  Notable Question (source)
2016-09-03 09:24:28 -0500 received badge  Editor (source)
2016-09-02 12:28:01 -0500 commented question Login in to account using cloud init script

I improved my question. Please check it out.

2016-09-01 07:23:33 -0500 received badge  Popular Question (source)
2016-08-31 15:23:50 -0500 asked a question Login in to account using cloud init script

I've been trying to automate the creation of a virtual machine using a cloud init script. I noted that this script is run using the machine root account. I wonder if it is possible to login in to the default machine account. For instance, I am currently using a trusty server image whose default login is ubuntu. I tried to do "sudo su ubuntu" in my cloud-init script, but unsuccessfully. It is weird because I don't get any error such as "No passwd entity for user". The script run this command (sudo su ubuntu), and right after - whoami, which returns "root". Is the default user created only after the cloud init is completed? Is too much exotic what I am trying to do?

My idea is to install some stuff (so far so good), then generate a ssh key adding it to the authorized keys. After that, I would snapshot the instance. The snapshot instance would be a "default" image to me start other instances afterwards. The tricky part is the ssh key generation. If I create a snapshot from an instance that can ssh to itself without password verification, when I launch other instances using that snapshot they will automatically be able to ssh to one another.

I was able to do this process without a cloud-init script, I wonder if I can do it by running a cloud-init script, in a more, automatic fashion (not having to login in to an image and deploy ssh stuff).

I am aware that I could use glance. When I said I was able to do it manually, I meant that I was using a process very similar. Instead of creating an image from scratch using a disk builder and uploading it to the cloud, I launched an instance, logged in to it, installed stuff, and configured ssh, then snapshot it (In my opinion it is a little easier than creating an image from scratch, moreover I've not been able to upload an image to the cloud I'm currently using, but that is another issue (I kinda got stuck and gave up :() - thus I decided to use this kind of approach).

2016-08-25 12:12:47 -0500 received badge  Famous Question (source)
2016-07-20 04:58:02 -0500 received badge  Notable Question (source)
2016-07-07 06:15:54 -0500 received badge  Popular Question (source)
2016-07-04 13:33:31 -0500 received badge  Scholar (source)
2016-07-04 07:38:42 -0500 commented question Can't connect to OpenStack Cloud using command line clients

Change OS_AUTH_URL? In openrc file? If yes, I already did it. My openrc file does only contain OS_AUTH_URL, OS_TENANT_ID, OS_TENANT_NAME, OS_PASSWORD and OS_REGION.

2016-06-29 15:41:57 -0500 asked a question Can't connect to OpenStack Cloud using command line clients

I've been trying to connect to the cloud using the command lines clients, but I've not been successfull. For instance, when I use the command:

glance --debug image-list

I get this output:

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py", line 142, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/util/connection.py", line 91, in create_connection
    raise err
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/util/connection.py", line 81, in create_connection
    sock.connect(sa)
TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 578, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 362, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.4/http/client.py", line 1088, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python3.4/http/client.py", line 1126, in _send_request
    self.endheaders(body)
  File "/usr/lib/python3.4/http/client.py", line 1084, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python3.4/http/client.py", line 922, in _send_output
    self.send(msg)
  File "/usr/lib/python3.4/http/client.py", line 857, in send
    self.connect()
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py", line 167, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py", line 151, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.HTTPConnection object at 0x7f59fddced30>: Failed to establish a new connection: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 403, in send
    timeout=timeout
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 623, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/util/retry.py", line 281, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='controller', port=9292): Max retries exceeded with url: /versions (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f59fddced30>: Failed to establish a new connection: [Errno 110] Connection timed out',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/keystoneclient/session.py", line 438, in _send_request
    resp = self.session.request(method, url, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 585, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/adapters ...
(more)