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