xenserver / xscontainer

Support for Docker and Container Management
BSD 2-Clause "Simplified" License
25 stars 14 forks source link

Trying to load 'Properties' of a CoreOS VM causes XenCenter to freeze #14

Closed danielschonfeld closed 8 years ago

danielschonfeld commented 9 years ago

It appears that reading the cloud-config is the reason for this, I get the following inside xsconstainer.log

2015-05-26 22:53:25 - [6295] - INFO - get_config_drive_configuration from vdi 37238363-93dd-4a58-8250-7cdb423493a0
2015-05-26 22:53:25 - [6295] - INFO - export_disk vdi 37238363-93dd-4a58-8250-7cdb423493a0
2015-05-26 22:53:25 - [6295] - INFO - Command ['curl', '-k', '-o', '/tmp/tmptLlF6m.raw', 'https://localhost/export_raw_vdi?session_id=OpaqueRef:8710ed6b-53dd-ac80-dd22-581b9307e9da&vdi=37238363-93dd-4a58-8250-7cdb423493a0&format=raw'] exited with rc 0: Stdout:  Stderr:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   255  100   255    0     0  16265      0 --:--:-- --:--:-- --:--:--     0

2015-05-26 22:53:25 - [6295] - INFO - Command ['mount', '-o', 'loop', '-t', 'iso9660', '/tmp/tmptLlF6m.raw', '/tmp/tmpeNwgFX'] exited with rc 32: Stdout:  Stderr: mount: /tmp/tmptLlF6m.raw is write-protected, mounting read-only
mount: wrong fs type, bad option, bad superblock on /dev/loop1,
       missing codepage or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

2015-05-26 22:53:25 - [6295] - ERROR - Nobody caught plugin exception: xscontainer.util.XSContainerException
2015-05-26 22:53:25 - [6295] - ERROR - Traceback (most recent call last):

2015-05-26 22:53:25 - [6295] - ERROR -   File "/etc/xapi.d/plugins/xscontainer", line 28, in decorated
    return func(*args, **kwargs)

2015-05-26 22:53:25 - [6295] - ERROR -   File "/etc/xapi.d/plugins/xscontainer", line 91, in get_config_drive_configuration
    args['vdiuuid']

2015-05-26 22:53:25 - [6295] - ERROR -   File "/usr/lib/python2.4/site-packages/xscontainer/coreos.py", line 274, in get_config_drive_configuration
    util.runlocal(cmd)

2015-05-26 22:53:25 - [6295] - ERROR -   File "/usr/lib/python2.4/site-packages/xscontainer/util/__init__.py", line 31, in runlocal
    raise(XSContainerException('Command failed'))

2015-05-26 22:53:25 - [6295] - ERROR - XSContainerException: Command failed

Interesting to note that even though above it says something about wrong FS type etc, the VM loads just fine with the cloud-config file being the one i expect and it mounts just fine.

So this problem is limited to trying to open that virtual disk only when calling get_config_drive_configuration

danielschonfeld commented 9 years ago

UPDATE: I have found out that the above error was the result of me moving the VM from a non pool master to the master machine, and XenServer not moving along the VM's Automatic Config Drive along with it. Rather the drive stayed on the original host the VM was created on.

As a result the exported ISO file to the /tmp directory had a byte size of 0 bytes.

However, I've noticed a similar problem when trying to load up Properties on a VM that is hosted on a non pool master. It's a very similar problem to the one above, with the ISO file being exported and created on the master machine, not on the machine where the VM is hosted, with a size of 0 bytes. As a result, no errors are generated but XenCenter just keeps spinning and hanging and never being able to load the cloud-config.

robertbreker commented 9 years ago

Thanks for reporting this, and also the fix in #15. It's an interesting bug, as it can only be seen when local storage is being used. I'll try to reproduce the behavior that you see when I get a free minute. That XenServer isn't moving the Automatic Config Drive sounds rather odd and I am not quite sure what may be causing this.

Best wishes, Robert

robertbreker commented 8 years ago

All flavors of this bug should be properly resolved by a combination of the above with the following Toolstack fixes: https://github.com/xapi-project/xen-api/commit/466afdfe103a58c502fcd5c6e6a1f538b4158ee9 https://github.com/xapi-project/xen-api/commit/c68cabcb6fbb284d37cf430a564dff715353e947 https://github.com/xapi-project/xen-api/commit/ebd0b2c19bad96fd3ff88c26b21d4945c90f7aad