stepping-stone / vm-manager

The stoney cloud web interface.
http://www.stoney-cloud.org/
Other
0 stars 0 forks source link

Additional disks are ignored when checking for streaming status #51

Closed dev-zero closed 10 years ago

dev-zero commented 10 years ago

The problem can be found in the VmController as well as the VmTemplateController:

VmController.php: actionRefreshVms

                                if (0 < count($templates)) {
                                    $state = 'preparing';
                                    $info = $libvirt->checkBlockJob($vm->node->getLibvirtUri(), $vm->sstVirtualMachine, 'vda');
                                    if (true !== $info) {
                                        $answer['progress'] = $info['cur'] / $info['end'] * 100;
                                    } 

Only the first disk is used to calculate the progress of streaming.

VmTemplateController.php: actionRefreshVms

                                $othervm = LdapVm::model()->findByAttributes(array('attr' => array('sstVirtualMachine' => $uuid)));
                                $info = $libvirt->checkBlockJob($othervm->node->getLibvirtUri(), $uuid, 'vda');
                                if (true === $info) {
                                    unset($prov[array_search($uuid, $prov)]);
                                }

This means that the VM manager does not check whether additional disks are still streaming before removing the reference, possibly leading to corrupt images!

This was on the todo list on September 23rd/24th (see emails).