[Openstack] [Spam: 5.7] Re: [Spam: 5.7] Re: Unable to create instance in openstack -- URGENT HELP

dheeru dheerendra.madhusudhana at gmail.com
Tue Dec 3 09:40:45 UTC 2013


Hi Karan

After applying the patch(api.py and guestfs.py as given by my) you are able
to create the instances. Is that correct ? Now you have problem in creating
the instance with falvors except tiny. Is that correct ?

Let us close this thread with closure notes and open the new request.

-dheeru
@Community Service


On Tue, Dec 3, 2013 at 2:32 PM, Karan Singh <ksingh at csc.fi> wrote:

> Sir Looks its also working for me now , but one other wired problem
>
> See my below logs
>
>
> [root at rdo vfs(keystone_admin)]# diff -uNr guestfs.py_orig guestfs.py
> --- guestfs.py_orig 2013-12-02 16:23:18.979000000 +0200
> +++ guestfs.py 2013-12-03 10:27:54.125000000 +0200
> @@ -123,17 +123,18 @@
> self.handle.aug_init("/", 0)
> except RuntimeError as e:
> # dereference object and implicitly close()
> - self.handle = None
> + #self.handle = None
> raise exception.NovaException(
> _("Error mounting %(imgfile)s with libguestfs (%(e)s)") %
> {'imgfile': self.imgfile, 'e': e})
> except Exception:
> - self.handle = None
> raise
>
> def teardown(self):
> LOG.debug(_("Tearing down appliance"))
>
> + if self.handle is None:
> + return
> try:
> try:
> self.handle.aug_close()
> [root at rdo vfs(keystone_admin)]#
>
>
>
>
> [root at rdo disk(keystone_admin)]#
> [root at rdo disk(keystone_admin)]# diff -uNr api.py_orig api.py
> --- api.py_orig 2013-12-02 16:26:53.493000000 +0200
> +++ api.py 2013-12-03 10:27:22.826000000 +0200
> @@ -63,14 +63,7 @@
>
> # escape such commas.
> #
> cfg.MultiStrOpt('virt_mkfs',
> - default=[
> - 'default=mkfs.ext3 -L %(fs_label)s -F %(target)s',
> - 'linux=mkfs.ext3 -L %(fs_label)s -F %(target)s',
> - 'windows=mkfs.ntfs'
> - ' --force --fast --label %(fs_label)s %(target)s',
> - # NOTE(yamahata): vfat case
> - #'windows=mkfs.vfat -n %(fs_label)s %(target)s',
> - ],
> + default=[],
>
> help='mkfs commands for ephemeral device. '
> 'The format is <os_type>=<mkfs command>'),
>
> @@ -85,10 +78,12 @@
>
> CONF = cfg.CONF
> CONF.register_opts(disk_opts)
> +CONF.import_opt('default_ephemeral_format', 'nova.virt.driver')
>
> _MKFS_COMMAND = {}
> _DEFAULT_MKFS_COMMAND = None
> -
> +_DEFAULT_FS_BY_OSTYPE = {'linux': 'ext3',
> + 'windows': 'ntfs'}
>
> for s in CONF.virt_mkfs:
> # NOTE(yamahata): mkfs command may includes '=' for its options.
> @@ -100,11 +95,24 @@
> _DEFAULT_MKFS_COMMAND = mkfs_command
>
>
> -def mkfs(os_type, fs_label, target):
> +def mkfs(os_type, fs_label, target, run_as_root=True):
> + """Format a file or block device using
> + a user provided command for each os type.
> + If user has not provided any configuration,
> + format type will be used according to a
> + default_ephemeral_format configuration
> + or a system defaults.
> + """
>
> +
> mkfs_command = (_MKFS_COMMAND.get(os_type, _DEFAULT_MKFS_COMMAND) or
> '') % {'fs_label': fs_label, 'target': target}
> if mkfs_command:
> - utils.execute(*mkfs_command.split(), run_as_root=True)
> + utils.execute(*mkfs_command.split(), run_as_root=run_as_root)
> + else:
> + default_fs = CONF.default_ephemeral_format
> + if not default_fs:
> + default_fs = _DEFAULT_FS_BY_OSTYPE.get(os_type, 'ext3')
> + utils.mkfs(default_fs, target, fs_label, run_as_root=run_as_root)
>
>
> def resize2fs(image, check_exit_code=False, run_as_root=False):
> @@ -172,23 +180,24 @@
>
> # Check the image is unpartitioned
> if use_cow:
> + fs = vfs.VFS.instance_for_image(image, 'qcow2', None)
> try:
> - fs = vfs.VFS.instance_for_image(image, 'qcow2', None)
> fs.setup()
> - fs.teardown()
>
> except exception.NovaException as e:
> LOG.debug(_('Unable to mount image %(image)s with '
> 'error %(error)s. Cannot resize.'),
> {'image': image,
> 'error': e})
> return False
> + finally:
> + fs.teardown()
>
> else:
> # For raw, we can directly inspect the file system
> try:
> utils.execute('e2label', image)
> except processutils.ProcessExecutionError as e:
> LOG.debug(_('Unable to determine label for image %(image)s with '
> - 'error %(errror)s. Cannot resize.'),
> + 'error %(error)s. Cannot resize.'),
>
> {'image': image,
> 'error': e})
> return False
> @@ -208,6 +217,8 @@
>
> self.mount_dir = mount_dir
> self.use_cow = use_cow
>
> + self.device = None
>
> +
> # Internal
> self._mkdir = False
> self._mounter = None
> @@ -239,6 +250,7 @@
>
> mount_name = os.path.basename(self.mount_dir or '')
> self._mkdir = mount_name.startswith(self.tmp_prefix)
> + self.device = self._mounter.device
>
> @property
> def errors(self):
> @@ -318,9 +330,14 @@
>
> fmt = "raw"
> if use_cow:
> fmt = "qcow2"
> - try:
> + # Note(mrda): Test if the image exists first to short circuit errors
> + os.stat(image)
>
> fs = vfs.VFS.instance_for_image(image, fmt, partition)
> + try:
> fs.setup()
> + fs.teardown()
> + return inject_data_into_fs(fs, key, net, metadata,
> + admin_password, files, mandatory)
>
> except Exception as e:
> # If a mandatory item is passed to this function,
> # then reraise the exception to indicate the error.
> @@ -332,18 +349,14 @@
>
> '(%(e)s)'), {'e': e})
> return False
>
> - try:
> - return inject_data_into_fs(fs, key, net, metadata,
> - admin_password, files, mandatory)
> - finally:
> - fs.teardown()
> -
>
> def setup_container(image, container_dir, use_cow=False):
> """Setup the LXC container.
>
> It will mount the loopback image to the container directory in order
> to create the root filesystem for the container.
> +
> + Returns path of image device which is mounted to the container directory.
>
> """
> img = _DiskImage(image=image, use_cow=use_cow, mount_dir=container_dir)
> if not img.mount():
> @@ -352,9 +365,11 @@
>
> {"image": img, "target": container_dir,
> "errors": img.errors})
> raise exception.NovaException(img.errors)
> + else:
> + return img.device
>
>
> -def teardown_container(container_dir):
> +def teardown_container(container_dir, container_root_device=None):
>
> """Teardown the container rootfs mounting once it is spawned.
>
> It will umount the container that is mounted,
> @@ -363,8 +378,19 @@
>
> try:
> img = _DiskImage(image=None, mount_dir=container_dir)
> img.teardown()
> +
> + # Make sure container_root_device is released when teardown container.
> + if container_root_device:
> + if 'loop' in container_root_device:
> + LOG.debug(_("Release loop device %s"), container_root_device)
> + utils.execute('losetup', '--detach', container_root_device,
> + run_as_root=True, attempts=3)
> + else:
> + LOG.debug(_('Release nbd device %s'), container_root_device)
> + utils.execute('qemu-nbd', '-d', container_root_device,
> + run_as_root=True)
> except Exception as exn:
> - LOG.exception(_('Failed to teardown ntainer filesystem: %s'), exn)
> + LOG.exception(_('Failed to teardown container filesystem: %s'), exn)
>
>
> def clean_lxc_namespace(container_dir):
> [root at rdo disk(keystone_admin)]#
>
>
>
>
> WEIRD PROBLEM - I am able to create instance with only small flavour , for
> rest other flavour TINY , MEDIUM , LARGE , XLARGE  instance is not getting
> created. See the below logs
>
>
>
>
> [root at rdo nova(keystone_admin)]# nova list
>
> +--------------------------------------+------------------+--------+------------+-------------+---------------------+
>
> | ID | Name | Status | Task State | Power State | Networks |
>
> +--------------------------------------+------------------+--------+------------+-------------+---------------------+
> | 1c1434dd-ce8f-40b1-bc28-46bf98023722 | instance1 | BUILD | spawning |
> NOSTATE | private=10.0.0.3 |
> | 0043a8be-60d1-43ed-ba43-1ccd0bba7559 | instance2 | ACTIVE | None |
> Running | public=172.24.4.228 |
> | 2cadb5a0-66f4-47f7-bdd1-8ca8cda4fb16 | instance4 | BUILD | spawning |
> NOSTATE | public=172.24.4.229 |
> | 63e4cacf-356d-4eb1-86d2-830428e1e257 | med-prescie | BUILD | spawning |
> NOSTATE | private=10.0.0.4 |
> | 9d3c327f-1893-40ff-8a82-16fad9ce6d91 | small-ubuntu | ACTIVE | None |
> Running | public=172.24.4.230 |
> | 10d1c49f-9fbc-455f-b72d-f731338b2dd5 | small-ubuntu-pwd | ACTIVE | None
> | Running | public=172.24.4.231 |
>
> +--------------------------------------+------------------+--------+------------+-------------+---------------------+
> [root at rdo nova(keystone_admin)]#
>
>
>
>
>
>
> Many Thanks
> Karan Singh
>
>
> ------------------------------
> *From: *"dheeru" <dheerendra.madhusudhana at gmail.com>
> *To: *"Karan Singh" <ksingh at csc.fi>
> *Sent: *Tuesday, 3 December, 2013 7:15:02 AM
> *Subject: *[Spam: 5.7] Re: [Spam: 5.7] Re: Unable to create instance in
> openstack -- URGENT HELP
>
>
> Hi Karan
>
>
> I tried the same files in my box. I just copied those two files to
> following directory. It started working fine.
> /usr/share/pyshared/nova/virt/disk/api.py
> /usr/share/pyshared/nova/virt/disk/vfs/guestfs.py
>
> I restarted the services and it is working fine. I'm re-attaching the
> files here. Please check.
>
> I don't why community is not helping. I'm just taking interest to help
> people on my own interest.
>
> -dheeru
> @Community Service
>
>
>
>
> On Tue, Dec 3, 2013 at 12:56 AM, Karan Singh <ksingh at csc.fi> wrote:
>
>> Sir i have done the following
>>
>> 1)  copied the files to correct directories
>> 2) restarted entire openstack
>> 3) on restarting service nova services are not coming UP
>>
>> [root at rdo init.d(keystone_admin)]# sh statusopenstack.sh | grep -v
>> running
>> openstack-nova-api dead but pid file exists
>> openstack-nova-cert dead but pid file exists
>> openstack-nova-compute dead but pid file exists
>> openstack-nova-conductor dead but pid file exists
>> openstack-nova-console dead but pid file exists
>> openstack-nova-consoleauth dead but pid file exists
>> openstack-nova-metadata-api dead but pid file exists
>> openstack-nova-scheduler dead but pid file exists
>> openstack-nova-spicehtml5proxy dead but pid file exists
>> [root at rdo init.d(keystone_admin)]#
>>
>>
>>
>> 4) after that i reverted the change done with the original file ( removed
>> new files and put on original files )
>>
>>
>> 5) restarted openstack services
>>
>>
>> 6) services are coming UP as usual
>>
>>
>> 7) But unable to create instance
>>
>>
>> Just want to highlight , the time where you were creating new files for
>> me , i was also doing the same here , but in my files also services are not
>> coming with modified files. but if i use original files service are coming
>> up.
>>
>>
>>
>> Dont know where is the issue , and i dont know why no one else in this
>> community replies ( every times you helps )  , are these errors too
>> difficult to be troubleshooted by them.
>>
>> Many Thanks
>> Karan Singh
>>
>>
>> ------------------------------
>> *From: *"dheeru" <dheerendra.madhusudhana at gmail.com>
>> *To: *"Karan Singh" <ksingh at csc.fi>
>> *Sent: *Monday, 2 December, 2013 8:18:09 PM
>> *Subject: *[Spam: 5.7] Re: Unable to create instance in openstack --
>> URGENT HELP
>>
>>
>> Hi
>>
>> nova/virt/disk/vfs/guestfs.py
>> nova/virt/disk/api.py
>>
>> Can you patch both the above files.
>>
>> 1. Keep the backup of orignail files
>> 2. Do the diff of old and new files
>> 3. Copy these two files in appropriate directory
>>
>> Restart your nova=compute service. Then see what happens.
>>
>> _Dheerendra
>>
>>
>> On Mon, Dec 2, 2013 at 11:45 PM, dheeru <
>> dheerendra.madhusudhana at gmail.com> wrote:
>>
>>> r you there ?
>>>
>>>
>>> On Mon, Dec 2, 2013 at 11:06 PM, Karan Singh <ksingh at csc.fi> wrote:
>>>
>>>> Hello Sir
>>>>
>>>> here is the orignial file api.py
>>>>
>>>>
>>>>
>>>>
>>>> # vim: tabstop=4 shiftwidth=4 softtabstop=4
>>>>
>>>> # Copyright 2010 United States Government as represented by the
>>>> # Administrator of the National Aeronautics and Space Administration.
>>>> #
>>>> # Copyright 2011, Piston Cloud Computing, Inc.
>>>> #
>>>> # All Rights Reserved.
>>>> #
>>>> # Licensed under the Apache License, Version 2.0 (the "License"); you
>>>> may
>>>> # not use this file except in compliance with the License. You may
>>>> obtain
>>>> # a copy of the License at
>>>> #
>>>> # http://www.apache.org/licenses/LICENSE-2.0
>>>> #
>>>> # Unless required by applicable law or agreed to in writing, software
>>>> # distributed under the License is distributed on an "AS IS" BASIS,
>>>> WITHOUT
>>>> # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
>>>> the
>>>> # License for the specific language governing permissions and
>>>> limitations
>>>> # under the License.
>>>> """
>>>> Utility methods to resize, repartition, and modify disk images.
>>>>
>>>> Includes injection of SSH PGP keys into authorized_keys file.
>>>>
>>>> """
>>>>
>>>> import os
>>>> import random
>>>> import tempfile
>>>>
>>>> if os.name != 'nt':
>>>> import crypt
>>>>
>>>> from oslo.config import cfg
>>>>
>>>> from nova import exception
>>>> from nova.openstack.common.gettextutils import _
>>>> from nova.openstack.common import jsonutils
>>>> from nova.openstack.common import log as logging
>>>> from nova.openstack.common import processutils
>>>> from nova import paths
>>>> from nova import utils
>>>> from nova.virt.disk.mount import api as mount
>>>> from nova.virt.disk.vfs import api as vfs
>>>> from nova.virt import images
>>>>
>>>>
>>>> LOG = logging.getLogger(__name__)
>>>>
>>>> disk_opts = [
>>>> cfg.StrOpt('injected_network_template',
>>>> default=paths.basedir_def('nova/virt/interfaces.template'),
>>>> help='Template file for injected network'),
>>>>
>>>> # NOTE(yamahata): ListOpt won't work because the command may include a
>>>> # comma. For example:
>>>> #
>>>> # mkfs.ext3 -O dir_index,extent -E stride=8,stripe-width=16
>>>> # --label %(fs_label)s %(target)s
>>>> #
>>>> # list arguments are comma separated and there is no way to
>>>> # escape such commas.
>>>> #
>>>> cfg.MultiStrOpt('virt_mkfs',
>>>> default=[
>>>> 'default=mkfs.ext3 -L %(fs_label)s -F %(target)s',
>>>> 'linux=mkfs.ext3 -L %(fs_label)s -F %(target)s',
>>>> 'windows=mkfs.ntfs'
>>>> ' --force --fast --label %(fs_label)s %(target)s',
>>>> # NOTE(yamahata): vfat case
>>>> #'windows=mkfs.vfat -n %(fs_label)s %(target)s',
>>>> ],
>>>> help='mkfs commands for ephemeral device. '
>>>> 'The format is <os_type>=<mkfs command>'),
>>>>
>>>> cfg.BoolOpt('resize_fs_using_block_device',
>>>> default=False,
>>>> help='Attempt to resize the filesystem by accessing the '
>>>> 'image over a block device. This is done by the host '
>>>> 'and may not be necessary if the image contains a recent '
>>>> 'version of cloud-init. Possible mechanisms require '
>>>> 'the nbd driver (for qcow and raw), or loop (for raw).'),
>>>> ]
>>>>
>>>> CONF = cfg.CONF
>>>> CONF.register_opts(disk_opts)
>>>>
>>>> _MKFS_COMMAND = {}
>>>> _DEFAULT_MKFS_COMMAND = None
>>>>
>>>>
>>>> for s in CONF.virt_mkfs:
>>>> # NOTE(yamahata): mkfs command may includes '=' for its options.
>>>> # So item.partition('=') doesn't work here
>>>> os_type, mkfs_command = s.split('=', 1)
>>>> if os_type:
>>>> _MKFS_COMMAND[os_type] = mkfs_command
>>>> if os_type == 'default':
>>>> _DEFAULT_MKFS_COMMAND = mkfs_command
>>>>
>>>>
>>>> def mkfs(os_type, fs_label, target):
>>>> mkfs_command = (_MKFS_COMMAND.get(os_type, _DEFAULT_MKFS_COMMAND) or
>>>> '') % {'fs_label': fs_label, 'target': target}
>>>> if mkfs_command:
>>>> utils.execute(*mkfs_command.split(), run_as_root=True)
>>>>
>>>>
>>>> def resize2fs(image, check_exit_code=False, run_as_root=False):
>>>> utils.execute('e2fsck', '-fp', image,
>>>> check_exit_code=check_exit_code,
>>>> run_as_root=run_as_root)
>>>> utils.execute('resize2fs', image,
>>>> check_exit_code=check_exit_code,
>>>> run_as_root=run_as_root)
>>>>
>>>>
>>>> def get_disk_size(path):
>>>> """Get the (virtual) size of a disk image
>>>>
>>>> :param path: Path to the disk image
>>>> :returns: Size (in bytes) of the given disk image as it would be seen
>>>> by a virtual machine.
>>>> """
>>>> return images.qemu_img_info(path).virtual_size
>>>>
>>>>
>>>> def extend(image, size, use_cow=False):
>>>> """Increase image to size."""
>>>> if not can_resize_image(image, size):
>>>> return
>>>>
>>>> utils.execute('qemu-img', 'resize', image, size)
>>>>
>>>> # if we can't access the filesystem, we can't do anything more
>>>> if not is_image_partitionless(image, use_cow):
>>>> return
>>>>
>>>> # NOTE(vish): attempts to resize filesystem
>>>> if use_cow:
>>>> if CONF.resize_fs_using_block_device:
>>>> # in case of non-raw disks we can't just resize the image, but
>>>> # rather the mounted device instead
>>>> mounter = mount.Mount.instance_for_format(image, None, None,
>>>> 'qcow2')
>>>> if mounter.get_dev():
>>>> resize2fs(mounter.device, run_as_root=True)
>>>> mounter.unget_dev()
>>>> else:
>>>> resize2fs(image)
>>>>
>>>>
>>>> def can_resize_image(image, size):
>>>> """Check whether we can resize the container image file."""
>>>> LOG.debug(_('Checking if we can resize image %(image)s. '
>>>> 'size=%(size)s'), {'image': image, 'size': size})
>>>>
>>>> # Check that we're increasing the size
>>>> virt_size = get_disk_size(image)
>>>> if virt_size >= size:
>>>> LOG.debug(_('Cannot resize image %s to a smaller size.'),
>>>> image)
>>>> return False
>>>> return True
>>>>
>>>>
>>>> def is_image_partitionless(image, use_cow=False):
>>>> """Check whether we can resize contained file system."""
>>>> LOG.debug(_('Checking if we can resize filesystem inside %(image)s. '
>>>> 'CoW=%(use_cow)s'), {'image': image, 'use_cow': use_cow})
>>>>
>>>> # Check the image is unpartitioned
>>>> if use_cow:
>>>> try:
>>>> fs = vfs.VFS.instance_for_image(image, 'qcow2', None)
>>>> fs.setup()
>>>> fs.teardown()
>>>> except exception.NovaException as e:
>>>> LOG.debug(_('Unable to mount image %(image)s with '
>>>> 'error %(error)s. Cannot resize.'),
>>>> {'image': image,
>>>> 'error': e})
>>>> return False
>>>> else:
>>>> # For raw, we can directly inspect the file system
>>>> try:
>>>> utils.execute('e2label', image)
>>>> except processutils.ProcessExecutionError as e:
>>>> LOG.debug(_('Unable to determine label for image %(image)s with '
>>>> 'error %(errror)s. Cannot resize.'),
>>>> {'image': image,
>>>> 'error': e})
>>>> return False
>>>>
>>>> return True
>>>>
>>>>
>>>> class _DiskImage(object):
>>>> """Provide operations on a disk image file."""
>>>>
>>>> tmp_prefix = 'openstack-disk-mount-tmp'
>>>>
>>>> def __init__(self, image, partition=None, use_cow=False,
>>>> mount_dir=None):
>>>> # These passed to each mounter
>>>> self.image = image
>>>> self.partition = partition
>>>> self.mount_dir = mount_dir
>>>> self.use_cow = use_cow
>>>>
>>>> # Internal
>>>> self._mkdir = False
>>>> self._mounter = None
>>>> self._errors = []
>>>>
>>>> if mount_dir:
>>>> device = self._device_for_path(mount_dir)
>>>> if device:
>>>> self._reset(device)
>>>>
>>>> @staticmethod
>>>> def _device_for_path(path):
>>>> device = None
>>>> path = os.path.realpath(path)
>>>> with open("/proc/mounts", 'r') as ifp:
>>>> for line in ifp:
>>>> fields = line.split()
>>>> if fields[1] == path:
>>>> device = fields[0]
>>>> break
>>>> return device
>>>>
>>>> def _reset(self, device):
>>>> """Reset internal state for a previously mounted directory."""
>>>> self._mounter = mount.Mount.instance_for_device(self.image,
>>>> self.mount_dir,
>>>> self.partition,
>>>> device)
>>>>
>>>> mount_name = os.path.basename(self.mount_dir or '')
>>>> self._mkdir = mount_name.startswith(self.tmp_prefix)
>>>>
>>>> @property
>>>> def errors(self):
>>>> """Return the collated errors from all operations."""
>>>> return '\n--\n'.join([''] + self._errors)
>>>>
>>>> def mount(self):
>>>> """Mount a disk image, using the object attributes.
>>>>
>>>> The first supported means provided by the mount classes is used.
>>>>
>>>> True, or False is returned and the 'errors' attribute
>>>> contains any diagnostics.
>>>> """
>>>> if self._mounter:
>>>> raise exception.NovaException(_('image already mounted'))
>>>>
>>>> if not self.mount_dir:
>>>> self.mount_dir = tempfile.mkdtemp(prefix=self.tmp_prefix)
>>>> self._mkdir = True
>>>>
>>>> imgfmt = "raw"
>>>> if self.use_cow:
>>>> imgfmt = "qcow2"
>>>>
>>>> mounter = mount.Mount.instance_for_format(self.image,
>>>> self.mount_dir,
>>>> self.partition,
>>>> imgfmt)
>>>> if mounter.do_mount():
>>>> self._mounter = mounter
>>>> else:
>>>> LOG.debug(mounter.error)
>>>> self._errors.append(mounter.error)
>>>>
>>>> return bool(self._mounter)
>>>>
>>>> def umount(self):
>>>> """Umount a mount point from the filesystem."""
>>>> if self._mounter:
>>>> self._mounter.do_umount()
>>>> self._mounter = None
>>>>
>>>> def teardown(self):
>>>> """Remove a disk image from the file system."""
>>>> try:
>>>> if self._mounter:
>>>> self._mounter.do_teardown()
>>>> self._mounter = None
>>>> finally:
>>>> if self._mkdir:
>>>> os.rmdir(self.mount_dir)
>>>>
>>>>
>>>> # Public module functions
>>>>
>>>> def inject_data(image, key=None, net=None, metadata=None,
>>>> admin_password=None,
>>>> files=None, partition=None, use_cow=False, mandatory=()):
>>>> """Inject the specified items into a disk image.
>>>>
>>>> If an item name is not specified in the MANDATORY iterable, then a
>>>> warning
>>>> is logged on failure to inject that item, rather than raising an
>>>> exception.
>>>>
>>>> it will mount the image as a fully partitioned disk and attempt to
>>>> inject
>>>> into the specified partition number.
>>>>
>>>> If PARTITION is not specified the image is mounted as a single
>>>> partition.
>>>>
>>>> Returns True if all requested operations completed without issue.
>>>> Raises an exception if a mandatory item can't be injected.
>>>> """
>>>> LOG.debug(_("Inject data image=%(image)s key=%(key)s net=%(net)s "
>>>> "metadata=%(metadata)s admin_password=<SANITIZED> "
>>>> "files=%(files)s partition=%(partition)s use_cow=%(use_cow)s"),
>>>> {'image': image, 'key': key, 'net': net, 'metadata': metadata,
>>>> 'files': files, 'partition': partition, 'use_cow': use_cow})
>>>> fmt = "raw"
>>>> if use_cow:
>>>> fmt = "qcow2"
>>>> try:
>>>> fs = vfs.VFS.instance_for_image(image, fmt, partition)
>>>> fs.setup()
>>>> except Exception as e:
>>>> # If a mandatory item is passed to this function,
>>>> # then reraise the exception to indicate the error.
>>>> for inject in mandatory:
>>>> inject_val = locals()[inject]
>>>> if inject_val:
>>>> raise
>>>> LOG.warn(_('Ignoring error injecting data into image '
>>>> '(%(e)s)'), {'e': e})
>>>> return False
>>>>
>>>> try:
>>>> return inject_data_into_fs(fs, key, net, metadata,
>>>> admin_password, files, mandatory)
>>>> finally:
>>>> fs.teardown()
>>>>
>>>>
>>>> def setup_container(image, container_dir, use_cow=False):
>>>> """Setup the LXC container.
>>>>
>>>> It will mount the loopback image to the container directory in order
>>>> to create the root filesystem for the container.
>>>> """
>>>> img = _DiskImage(image=image, use_cow=use_cow, mount_dir=container_dir)
>>>> if not img.mount():
>>>> LOG.error(_("Failed to mount container filesystem '%(image)s' "
>>>> "on '%(target)s': %(errors)s"),
>>>> {"image": img, "target": container_dir,
>>>> "errors": img.errors})
>>>> raise exception.NovaException(img.errors)
>>>>
>>>>
>>>> def teardown_container(container_dir):
>>>> """Teardown the container rootfs mounting once it is spawned.
>>>>
>>>> It will umount the container that is mounted,
>>>> and delete any linked devices.
>>>> """
>>>> try:
>>>> img = _DiskImage(image=None, mount_dir=container_dir)
>>>> img.teardown()
>>>> except Exception as exn:
>>>> LOG.exception(_('Failed to teardown ntainer filesystem: %s'), exn)
>>>>
>>>>
>>>> def clean_lxc_namespace(container_dir):
>>>> """Clean up the container namespace rootfs mounting one spawned.
>>>>
>>>> It will umount the mounted names that are mounted
>>>> but leave the linked devices alone.
>>>> """
>>>> try:
>>>> img = _DiskImage(image=None, mount_dir=container_dir)
>>>> img.umount()
>>>> except Exception as exn:
>>>> LOG.exception(_('Failed to umount container filesystem: %s'), exn)
>>>>
>>>>
>>>> def inject_data_into_fs(fs, key, net, metadata, admin_password, files,
>>>> mandatory=()):
>>>> """Injects data into a filesystem already mounted by the caller.
>>>> Virt connections can call this directly if they mount their fs
>>>> in a different way to inject_data.
>>>>
>>>> If an item name is not specified in the MANDATORY iterable, then a
>>>> warning
>>>> is logged on failure to inject that item, rather than raising an
>>>> exception.
>>>>
>>>> Returns True if all requested operations completed without issue.
>>>> Raises an exception if a mandatory item can't be injected.
>>>> """
>>>> status = True
>>>> for inject in ('key', 'net', 'metadata', 'admin_password', 'files'):
>>>> inject_val = locals()[inject]
>>>> inject_func = globals()['_inject_%s_into_fs' % inject]
>>>> if inject_val:
>>>> try:
>>>> inject_func(inject_val, fs)
>>>> except Exception as e:
>>>> if inject in mandatory:
>>>> raise
>>>> LOG.warn(_('Ignoring error injecting %(inject)s into image '
>>>> '(%(e)s)'), {'e': e, 'inject': inject})
>>>> status = False
>>>> return status
>>>>
>>>>
>>>> def _inject_files_into_fs(files, fs):
>>>> for (path, contents) in files:
>>>> _inject_file_into_fs(fs, path, contents)
>>>>
>>>>
>>>> def _inject_file_into_fs(fs, path, contents, append=False):
>>>> LOG.debug(_("Inject file fs=%(fs)s path=%(path)s append=%(append)s"),
>>>> {'fs': fs, 'path': path, 'append': append})
>>>> if append:
>>>> fs.append_file(path, contents)
>>>> else:
>>>> fs.replace_file(path, contents)
>>>>
>>>>
>>>> def _inject_metadata_into_fs(metadata, fs):
>>>> LOG.debug(_("Inject metadata fs=%(fs)s metadata=%(metadata)s"),
>>>> {'fs': fs, 'metadata': metadata})
>>>> metadata = dict([(m['key'], m['value']) for m in metadata])
>>>> _inject_file_into_fs(fs, 'meta.js', jsonutils.dumps(metadata))
>>>>
>>>>
>>>> def _setup_selinux_for_keys(fs, sshdir):
>>>> """Get selinux guests to ensure correct context on injected keys."""
>>>>
>>>> if not fs.has_file(os.path.join("etc", "selinux")):
>>>> return
>>>>
>>>> rclocal = os.path.join('etc', 'rc.local')
>>>> rc_d = os.path.join('etc', 'rc.d')
>>>>
>>>> if not fs.has_file(rclocal) and fs.has_file(rc_d):
>>>> rclocal = os.path.join(rc_d, 'rc.local')
>>>>
>>>> # Note some systems end rc.local with "exit 0"
>>>> # and so to append there you'd need something like:
>>>> # utils.execute('sed', '-i', '${/^exit 0$/d}' rclocal, run_as_root=True)
>>>> restorecon = [
>>>> '\n',
>>>> '# Added by Nova to ensure injected ssh keys have the right context\n',
>>>> 'restorecon -RF %s 2>/dev/null || :\n' % sshdir,
>>>> ]
>>>>
>>>> if not fs.has_file(rclocal):
>>>> restorecon.insert(0, '#!/bin/sh')
>>>>
>>>> _inject_file_into_fs(fs, rclocal, ''.join(restorecon), append=True)
>>>> fs.set_permissions(rclocal, 0o700)
>>>>
>>>>
>>>> def _inject_key_into_fs(key, fs):
>>>> """Add the given public ssh key to root's authorized_keys.
>>>>
>>>> key is an ssh key string.
>>>> fs is the path to the base of the filesystem into which to inject the
>>>> key.
>>>> """
>>>>
>>>> LOG.debug(_("Inject key fs=%(fs)s key=%(key)s"), {'fs': fs, 'key': key})
>>>> sshdir = os.path.join('root', '.ssh')
>>>> fs.make_path(sshdir)
>>>> fs.set_ownership(sshdir, "root", "root")
>>>> fs.set_permissions(sshdir, 0o700)
>>>>
>>>> keyfile = os.path.join(sshdir, 'authorized_keys')
>>>>
>>>> key_data = ''.join([
>>>> '\n',
>>>> '# The following ssh key was injected by Nova',
>>>> '\n',
>>>> key.strip(),
>>>> '\n',
>>>> ])
>>>>
>>>> _inject_file_into_fs(fs, keyfile, key_data, append=True)
>>>> fs.set_permissions(keyfile, 0o600)
>>>>
>>>> _setup_selinux_for_keys(fs, sshdir)
>>>>
>>>>
>>>> def _inject_net_into_fs(net, fs):
>>>> """Inject /etc/network/interfaces into the filesystem rooted at fs.
>>>>
>>>> net is the contents of /etc/network/interfaces.
>>>> """
>>>>
>>>> LOG.debug(_("Inject key fs=%(fs)s net=%(net)s"), {'fs': fs, 'net': net})
>>>> netdir = os.path.join('etc', 'network')
>>>> fs.make_path(netdir)
>>>> fs.set_ownership(netdir, "root", "root")
>>>> fs.set_permissions(netdir, 0o744)
>>>>
>>>> netfile = os.path.join('etc', 'network', 'interfaces')
>>>> _inject_file_into_fs(fs, netfile, net)
>>>>
>>>>
>>>> def _inject_admin_password_into_fs(admin_passwd, fs):
>>>> """Set the root password to admin_passwd
>>>>
>>>> admin_password is a root password
>>>> fs is the path to the base of the filesystem into which to inject
>>>> the key.
>>>>
>>>> This method modifies the instance filesystem directly,
>>>> and does not require a guest agent running in the instance.
>>>>
>>>> """
>>>> # The approach used here is to copy the password and shadow
>>>> # files from the instance filesystem to local files, make any
>>>> # necessary changes, and then copy them back.
>>>>
>>>> LOG.debug(_("Inject admin password fs=%(fs)s "
>>>> "admin_passwd=<SANITIZED>"), {'fs': fs})
>>>> admin_user = 'root'
>>>>
>>>> fd, tmp_passwd = tempfile.mkstemp()
>>>> os.close(fd)
>>>> fd, tmp_shadow = tempfile.mkstemp()
>>>> os.close(fd)
>>>>
>>>> passwd_path = os.path.join('etc', 'passwd')
>>>> shadow_path = os.path.join('etc', 'shadow')
>>>>
>>>> passwd_data = fs.read_file(passwd_path)
>>>> shadow_data = fs.read_file(shadow_path)
>>>>
>>>> new_shadow_data = _set_passwd(admin_user, admin_passwd,
>>>> passwd_data, shadow_data)
>>>>
>>>> fs.replace_file(shadow_path, new_shadow_data)
>>>>
>>>>
>>>> def _generate_salt():
>>>> salt_set = ('abcdefghijklmnopqrstuvwxyz'
>>>> 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
>>>> '0123456789./')
>>>> salt = 16 * ' '
>>>> return ''.join([random.choice(salt_set) for c in salt])
>>>>
>>>>
>>>> def _set_passwd(username, admin_passwd, passwd_data, shadow_data):
>>>> """set the password for username to admin_passwd
>>>>
>>>> The passwd_file is not modified. The shadow_file is updated.
>>>> if the username is not found in both files, an exception is raised.
>>>>
>>>> :param username: the username
>>>> :param encrypted_passwd: the encrypted password
>>>> :param passwd_file: path to the passwd file
>>>> :param shadow_file: path to the shadow password file
>>>> :returns: nothing
>>>> :raises: exception.NovaException(), IOError()
>>>>
>>>> """
>>>> if os.name == 'nt':
>>>> raise exception.NovaException(_('Not implemented on Windows'))
>>>>
>>>> # encryption algo - id pairs for crypt()
>>>> algos = {'SHA-512': '$6$', 'SHA-256': '$5$', 'MD5': '$1$', 'DES': ''}
>>>>
>>>> salt = _generate_salt()
>>>>
>>>> # crypt() depends on the underlying libc, and may not support all
>>>> # forms of hash. We try md5 first. If we get only 13 characters back,
>>>> # then the underlying crypt() didn't understand the '$n$salt' magic,
>>>> # so we fall back to DES.
>>>> # md5 is the default because it's widely supported. Although the
>>>> # local crypt() might support stronger SHA, the target instance
>>>> # might not.
>>>> encrypted_passwd = crypt.crypt(admin_passwd, algos['MD5'] + salt)
>>>> if len(encrypted_passwd) == 13:
>>>> encrypted_passwd = crypt.crypt(admin_passwd, algos['DES'] + salt)
>>>>
>>>> p_file = passwd_data.split("\n")
>>>> s_file = shadow_data.split("\n")
>>>>
>>>> # username MUST exist in passwd file or it's an error
>>>> found = False
>>>> for entry in p_file:
>>>> split_entry = entry.split(':')
>>>> if split_entry[0] == username:
>>>> found = True
>>>> break
>>>> if not found:
>>>> msg = _('User %(username)s not found in password file.')
>>>> raise exception.NovaException(msg % username)
>>>>
>>>> # update password in the shadow file.It's an error if the
>>>> # the user doesn't exist.
>>>> new_shadow = list()
>>>> found = False
>>>> for entry in s_file:
>>>> split_entry = entry.split(':')
>>>> if split_entry[0] == username:
>>>> split_entry[1] = encrypted_passwd
>>>> found = True
>>>> new_entry = ':'.join(split_entry)
>>>> new_shadow.append(new_entry)
>>>>
>>>> if not found:
>>>> msg = _('User %(username)s not found in shadow file.')
>>>> raise exception.NovaException(msg % username)
>>>>
>>>> return "\n".join(new_shadow)
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Many Thanks
>>>> Karan Singh
>>>>
>>>>
>>>> ------------------------------
>>>> *From: *"Karan Singh" <ksingh at csc.fi>
>>>> *To: *"dheeru" <dheerendra.madhusudhana at gmail.com>, "Openstack Milis" <
>>>> openstack at lists.openstack.org>
>>>> *Sent: *Monday, 2 December, 2013 7:10:47 PM
>>>>
>>>> *Subject: *Re: Unable to create instance in openstack -- URGENT HELP
>>>>
>>>> Hello Sir
>>>>
>>>> Please find the latest logs
>>>>
>>>> http://pastebin.com/aTWfDq7u
>>>>
>>>> Many Thanks
>>>> Karan Singh
>>>>
>>>>
>>>> ------------------------------
>>>> *From: *"Karan Singh" <ksingh at csc.fi>
>>>> *To: *"dheeru" <dheerendra.madhusudhana at gmail.com>, "Openstack Milis" <
>>>> openstack at lists.openstack.org>
>>>> *Sent: *Monday, 2 December, 2013 6:46:36 PM
>>>> *Subject: *Re: Unable to create instance in openstack -- URGENT HELP
>>>>
>>>> Dear Sir
>>>>
>>>> As required below libvirtd.logs
>>>>
>>>>
>>>>
>>>> 2013-11-29 09:41:11.250+0000: 2520: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-11-29 09:41:13.571+0000: 2520: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-11-29 10:20:12.381+0000: 2533: info : libvirt version: 0.10.2,
>>>> package: 18.el6_4.15 (CentOS BuildSystem <http://bugs.centos.org>,
>>>> 2013-11-13-10:44:00, c6b8.bsys.dev.centos.org)
>>>> 2013-11-29 10:20:12.381+0000: 2533: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-11-29 10:20:15.438+0000: 2533: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-11-29 10:24:46.064+0000: 2525: info : libvirt version: 0.10.2,
>>>> package: 18.el6_4.15 (CentOS BuildSystem <http://bugs.centos.org>,
>>>> 2013-11-13-10:44:00, c6b8.bsys.dev.centos.org)
>>>> 2013-11-29 10:24:46.064+0000: 2525: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-11-29 11:19:19.913+0000: 2489: info : libvirt version: 0.10.2,
>>>> package: 18.el6_4.15 (CentOS BuildSystem <http://bugs.centos.org>,
>>>> 2013-11-13-10:44:00, c6b8.bsys.dev.centos.org)
>>>> 2013-11-29 11:19:19.913+0000: 2489: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-11-29 11:19:25.722+0000: 2489: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-11-29 11:50:11.845+0000: 2494: warning :
>>>> qemuSetupCgroupForVcpu:580 : Unable to get vcpus' pids.
>>>> 2013-11-29 12:24:47.471+0000: 2494: warning :
>>>> qemuSetupCgroupForVcpu:580 : Unable to get vcpus' pids.
>>>> 2013-11-29 12:59:08.143+0000: 2490: error : qemuDomainOpenConsole:12948
>>>> : internal error character device (null) is not using a PTY
>>>> 2013-11-29 13:06:08.595+0000: 2489: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-11-29 13:09:37.305+0000: 2489: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-11-29 13:14:50.315+0000: 2494: warning :
>>>> qemuSetupCgroupForVcpu:580 : Unable to get vcpus' pids.
>>>> 2013-11-29 13:24:50.097+0000: 2489: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-11-29 13:35:18.692+0000: 2489: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-11-29 13:54:52.224+0000: 2489: error : daemonStreamEvent:225 :
>>>> stream had unexpected termination
>>>> 2013-11-29 13:54:52.224+0000: 2489: error :
>>>> virFDStreamUpdateCallback:120 : internal error stream is not open
>>>> 2013-11-29 13:55:07.583+0000: 2492: warning :
>>>> qemuSetupCgroupForVcpu:580 : Unable to get vcpus' pids.
>>>> 2013-11-29 13:55:08.628+0000: 2489: error : daemonStreamEvent:225 :
>>>> stream had unexpected termination
>>>> 2013-11-29 13:55:08.628+0000: 2489: error :
>>>> virFDStreamUpdateCallback:120 : internal error stream is not open
>>>> 2013-11-29 13:55:16.578+0000: 2492: warning :
>>>> qemuSetupCgroupForVcpu:580 : Unable to get vcpus' pids.
>>>> 2013-11-29 13:55:17.545+0000: 2489: error : daemonStreamEvent:225 :
>>>> stream had unexpected termination
>>>> 2013-11-29 13:55:17.545+0000: 2489: error :
>>>> virFDStreamUpdateCallback:120 : internal error stream is not open
>>>> 2013-11-29 13:55:27.284+0000: 2492: warning :
>>>> qemuSetupCgroupForVcpu:580 : Unable to get vcpus' pids.
>>>> 2013-11-29 13:55:28.272+0000: 2489: error : daemonStreamEvent:225 :
>>>> stream had unexpected termination
>>>> 2013-11-29 13:55:28.272+0000: 2489: error :
>>>> virFDStreamUpdateCallback:120 : internal error stream is not open
>>>> 2013-11-29 13:56:22.525+0000: 2491: warning :
>>>> qemuSetupCgroupForVcpu:580 : Unable to get vcpus' pids.
>>>> 2013-11-29 13:56:23.585+0000: 2489: error : daemonStreamEvent:225 :
>>>> stream had unexpected termination
>>>> 2013-11-29 13:56:23.586+0000: 2489: error :
>>>> virFDStreamUpdateCallback:120 : internal error stream is not open
>>>> 2013-11-29 13:56:31.563+0000: 2491: warning :
>>>> qemuSetupCgroupForVcpu:580 : Unable to get vcpus' pids.
>>>> 2013-11-29 15:43:31.025+0000: 2489: warning :
>>>> virKeepAliveTimerInternal:156 : No response from client 0x14adf80 after 5
>>>> keepalive messages in 30 seconds
>>>> 2013-11-30 21:48:50.136+0000: 2489: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-11-30 21:48:54.059+0000: 2489: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-11-30 21:48:54.059+0000: 2489: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-11-30 21:58:46.036+0000: 2493: warning :
>>>> qemuSetupCgroupForVcpu:580 : Unable to get vcpus' pids.
>>>> 2013-12-01 17:29:43.804+0000: 2489: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-12-01 17:29:48.635+0000: 2489: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-12-01 17:29:48.635+0000: 2489: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-12-02 08:49:50.604+0000: 2491: warning :
>>>> qemuSetupCgroupForVcpu:580 : Unable to get vcpus' pids.
>>>> 2013-12-02 09:16:23.799+0000: 2492: warning :
>>>> qemuSetupCgroupForVcpu:580 : Unable to get vcpus' pids.
>>>> 2013-12-02 09:22:00.598+0000: 2493: warning :
>>>> qemuSetupCgroupForVcpu:580 : Unable to get vcpus' pids.
>>>> 2013-12-02 09:27:09.381+0000: 2489: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-12-02 09:27:13.848+0000: 2489: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-12-02 10:03:22.926+0000: 2529: info : libvirt version: 0.10.2,
>>>> package: 18.el6_4.15 (CentOS BuildSystem <http://bugs.centos.org>,
>>>> 2013-11-13-10:44:00, c6b8.bsys.dev.centos.org)
>>>> 2013-12-02 10:03:22.926+0000: 2529: warning :
>>>> qemuSetupCgroupForVcpu:580 : Unable to get vcpus' pids.
>>>> 2013-12-02 10:03:22.956+0000: 2525: error : qemuMonitorIORead:514 :
>>>> Unable to read from monitor: Connection reset by peer
>>>> 2013-12-02 10:08:46.167+0000: 2527: warning :
>>>> qemuSetupCgroupForVcpu:580 : Unable to get vcpus' pids.
>>>> 2013-12-02 10:08:46.182+0000: 2525: error : qemuMonitorIO:614 :
>>>> internal error End of file from monitor
>>>> 2013-12-02 10:09:30.857+0000: 2529: warning :
>>>> qemuSetupCgroupForVcpu:580 : Unable to get vcpus' pids.
>>>> 2013-12-02 10:09:30.876+0000: 2525: error : qemuMonitorIO:614 :
>>>> internal error End of file from monitor
>>>> 2013-12-02 10:09:45.008+0000: 2526: warning :
>>>> qemuSetupCgroupForVcpu:580 : Unable to get vcpus' pids.
>>>> 2013-12-02 10:09:45.032+0000: 2525: error : qemuMonitorIO:614 :
>>>> internal error End of file from monitor
>>>> 2013-12-02 10:58:08.158+0000: 2525: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-12-02 10:58:15.379+0000: 2525: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-12-02 10:58:15.381+0000: 2525: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-12-02 11:01:32.174+0000: 2525: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-12-02 11:01:41.094+0000: 2525: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-12-02 11:01:41.095+0000: 2525: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-12-02 11:04:20.506+0000: 2525: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-12-02 11:11:58.003+0000: 2557: info : libvirt version: 0.10.2,
>>>> package: 18.el6_4.15 (CentOS BuildSystem <http://bugs.centos.org>,
>>>> 2013-11-13-10:44:00, c6b8.bsys.dev.centos.org)
>>>> 2013-12-02 11:11:58.003+0000: 2557: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-12-02 11:40:14.268+0000: 2567: info : libvirt version: 0.10.2,
>>>> package: 18.el6_4.15 (CentOS BuildSystem <http://bugs.centos.org>,
>>>> 2013-11-13-10:44:00, c6b8.bsys.dev.centos.org)
>>>> 2013-12-02 11:40:14.268+0000: 2567: warning :
>>>> qemuSetupCgroupForVcpu:580 : Unable to get vcpus' pids.
>>>> 2013-12-02 11:40:14.295+0000: 2563: error : qemuMonitorIO:614 :
>>>> internal error End of file from monitor
>>>> 2013-12-02 12:34:20.763+0000: 2563: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-12-02 12:34:27.487+0000: 2563: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-12-02 12:43:33.999+0000: 2567: warning :
>>>> qemuSetupCgroupForVcpu:580 : Unable to get vcpus' pids.
>>>> 2013-12-02 12:43:34.025+0000: 2563: error : qemuMonitorIO:614 :
>>>> internal error End of file from monitor
>>>> 2013-12-02 13:31:14.380+0000: 2563: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-12-02 13:31:18.145+0000: 2563: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-12-02 13:31:18.145+0000: 2563: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-12-02 13:48:17.544+0000: 2570: info : libvirt version: 0.10.2,
>>>> package: 18.el6_4.15 (CentOS BuildSystem <http://bugs.centos.org>,
>>>> 2013-11-13-10:44:00, c6b8.bsys.dev.centos.org)
>>>> 2013-12-02 13:48:17.544+0000: 2570: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-12-02 14:27:22.848+0000: 2570: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-12-02 14:27:22.849+0000: 2570: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-12-02 14:29:48.474+0000: 2570: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-12-02 14:32:04.112+0000: 2570: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-12-02 14:32:49.966+0000: 2570: error : virNetSocketReadWire:1194 :
>>>> End of file while reading data: Input/output error
>>>> 2013-12-02 14:42:54.192+0000: 2571: warning :
>>>> qemuSetupCgroupForVcpu:580 : Unable to get vcpus' pids.
>>>> 2013-12-02 14:42:54.209+0000: 2570: error : qemuMonitorIO:614 :
>>>> internal error End of file from monitor
>>>> [root at rdo libvirt(keystone_admin)]#
>>>>
>>>> Many Thanks
>>>> Karan Singh
>>>>
>>>>
>>>> ------------------------------
>>>> *From: *"Karan Singh" <ksingh at csc.fi>
>>>> *To: *"dheeru" <dheerendra.madhusudhana at gmail.com>, "Openstack Milis" <
>>>> openstack at lists.openstack.org>
>>>> *Sent: *Monday, 2 December, 2013 6:34:11 PM
>>>> *Subject: *Fwd: Unable to create instance in openstack -- URGENT HELP
>>>>
>>>> Looping Mr. Dheerendra
>>>>
>>>> Many Thanks
>>>> Karan Singh
>>>>
>>>>
>>>> ------------------------------
>>>> *From: *"Karan Singh" <ksingh at csc.fi>
>>>> *To: *"Openstack Milis" <openstack at lists.openstack.org>
>>>> *Sent: *Monday, 2 December, 2013 5:00:21 PM
>>>> *Subject: *Unable to create instance in openstack -- URGENT HELP
>>>>
>>>> Guys
>>>>
>>>> Need your help i am unable to create any new instance in openstack ,
>>>> After creating instance  task status remains on SPAWNING  , it doesnt
>>>> changes after that.
>>>>
>>>>
>>>> [root at rdo init.d(keystone_admin)]# nova list
>>>>
>>>> +--------------------------------------+-----------+--------+------------+-------------+---------------------+
>>>> | ID | Name | Status | Task State | Power State | Networks |
>>>>
>>>> +--------------------------------------+-----------+--------+------------+-------------+---------------------+
>>>> | 66c756b5-7263-411a-94ae-8d3e367f093e | instance2 | BUILD | spawning |
>>>> NOSTATE | public=172.24.4.228 |
>>>>
>>>> +--------------------------------------+-----------+--------+------------+-------------+---------------------+
>>>> [root at rdo init.d(keystone_admin)]#
>>>>
>>>>
>>>>
>>>> While checking nova/compute.logs   got the following messages
>>>>
>>>>
>>>>
>>>> 2013-12-02 13:40:10.886 3133 DEBUG nova.virt.disk.api
>>>> [req-0f588fcd-5aa8-493c-ab29-8a3578b1eb86 99f8019ba2694d78a680a5de46aa1afd
>>>> 0dafe42cfde242ddbb67b681f59bdb00] Unable to mount image
>>>> /var/lib/nova/instances/0742a7e1-0cb4-4d91-bb88-d6b302a59cfe/disk with
>>>> error Error mounting
>>>> /var/lib/nova/instances/0742a7e1-0cb4-4d91-bb88-d6b302a59cfe/disk with
>>>> libguestfs (mkdtemp: Permission denied). Cannot resize.
>>>> is_image_partitionless
>>>> /usr/lib/python2.6/site-packages/nova/virt/disk/api.py:183
>>>>
>>>> 2013-12-02 13:40:11.036 3133 WARNING nova.virt.disk.api
>>>> [req-0f588fcd-5aa8-493c-ab29-8a3578b1eb86 99f8019ba2694d78a680a5de46aa1afd
>>>> 0dafe42cfde242ddbb67b681f59bdb00] Ignoring error injecting data into image
>>>> (Error mounting
>>>> /var/lib/nova/instances/0742a7e1-0cb4-4d91-bb88-d6b302a59cfe/disk with
>>>> libguestfs (mkdtemp: Permission denied))
>>>>
>>>>
>>>>
>>>> Can you please help me troubleshooting on a urgent node.
>>>>
>>>>
>>>> Furniture --- centos 6.4 , Opensack Havana
>>>>
>>>>
>>>>
>>>> Karan Singh
>>>> Systems Specialist, Computing Environments Group
>>>> CSC - IT Center for Science Ltd.
>>>> P.O. Box 405, FI-02101 Espoo, FINLAND
>>>> http://www.csc.fi/ | +358 (0) 503 812758
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> -dheeru
>>> @Community Service
>>>
>>
>>
>>
>> --
>> -dheeru
>> @Community Service
>>
>>
>
>
> --
> -dheeru
> @Community Service
>
>


-- 
-dheeru
@Community Service
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20131203/5d836b88/attachment.html>


More information about the Openstack mailing list