I cant login to cloned image on Rackspace

739 views Asked by At

I have an instance in my account that I can login to ssh with port 27891. When I clone it ( make an image and from an image a server) I can´t access it with the password Rackspace gave me to root.

I´ve tried with port 22 and with port 27891 and neither work.

I´ll appreciate help!!

Thanks..

1

There are 1 answers

3
Kyle Kelley On BEST ANSWER

Cloned servers don't have the same password. You'll need to grab the admin password either from the UI or the API you're using. If you need to, you can always change the password as well:

Change Password dialog

On the other hand, I highly recommend using SSH keypairs with Rackspace boxes. You'll need to use the API (or one of the SDKs), but it makes it much easier to manage the boxes. Additionally, the authorized_keys file will be on each of the cloned images.

Example cloning code, using pyrax (the Python library for Rackspace):

# Authenticate with Rackspace -- also works against OpenStack/Keystone
pyrax.set_setting("identity_type", "rackspace")
pyrax.set_credential_file(os.path.expanduser("~/.rax_creds"))
cs = pyrax.connect_to_cloudservers(region="DFW")

# Could use the API to get image IDs
# This one is for Ubuntu 13.04 (Raring Ringtail) (PVHVM beta)
image = u'62df001e-87ee-407c-b042-6f4e13f5d7e1'
flavor = u'performance1-1'

# Create a server (solely to make an image out of it, for this example)
base_server = cs.servers.create("makeanimageoutofme",
                                image,
                                flavor,
                                key_name="rgbkrk")

# It takes a little while to create the server, so we poll it until it completes
base_server = pyrax.utils.wait_for_build(base_server, verbose=True)

# Create image
im = base_server.create_image("base_image")
image = cs.images.get(im)
# Wait for image creation to finish
image = pyrax.utils.wait_until(image, "status", "ACTIVE", attempts=0)

# Note that a clone can be a bigger flavor (VM size) if needed as well
# Here we use the flavor of the base server
clone_server = cs.servers.create(name="iamtheclone",
                                 image=image.id,
                                 flavor=base_server.flavor['id'])

clone_server = pyrax.utils.wait_for_build(clone_server, verbose=True)

Within each of the created machines, the generated credentials are in base_server.adminPass and clone_server.adminPass. To access the box, use base_server.accessIPv4 and clone_server.accessIPv4.

However, I highly recommend using SSH keypairs.