Bug 1148379
| Summary: | In case of using new template version (sealed with sysprep) for a pool, VMs get stuck in minisetup | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Virtualization Manager | Reporter: | Tomas Dosek <tdosek> |
| Component: | ovirt-engine | Assignee: | Omer Frenkel <ofrenkel> |
| Status: | CLOSED ERRATA | QA Contact: | Nisim Simsolo <nsimsolo> |
| Severity: | medium | Docs Contact: | |
| Priority: | high | ||
| Version: | 3.4.0 | CC: | bkorren, ecohen, iheim, lpeer, lsurette, mavital, michal.skrivanek, nyechiel, ofrenkel, rbalakri, Rhev-m-bugs, yeylon |
| Target Milestone: | --- | ||
| Target Release: | 3.5.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | virt | ||
| Fixed In Version: | org.ovirt.engine-root-3.5.0-19 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-02-11 18:09:16 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Tomas Dosek
2014-10-01 10:26:54 UTC
Just for clarification 32TEST1 in the query refers to the core pool name from which we derive the VM name for VM in pool. Also is_initialized parameter needs to be updated for the workaround to be complete: DO $do$ DECLARE v_vm_guid uuid; BEGIN FOR v_vm_guid IN (SELECT vm_guid FROM vm_static WHERE vm_name LIKE '%NAME_OF_POOL%') LOOP INSERT INTO vm_init (vm_id,domain,regenerate_keys,time_zone) VALUES (v_vm_guid,'example.domain.com','f','Central European Standard Time'); UPDATE vm_static SET is_initialized = 'f' WHERE vm_guid = v_vm_guid; END LOOP; END; $do$; Complete query for upgrade of template version and fix for the behavior in this BZ is:
CREATE OR REPLACE FUNCTION test_func()
RETURNS void
AS $$
DECLARE v_vm_guid uuid; v_uuid uuid;
BEGIN
FOR v_vm_guid IN (SELECT vm_guid FROM vm_static WHERE vm_name LIKE '%VM_POOL_NAME%') LOOP
IF EXISTS (SELECT vm_id FROM vm_init WHERE vm_id = v_vm_guid) THEN
RAISE NOTICE 'Not updating vm_init, record exists';
ELSE
INSERT INTO vm_init (vm_id,domain,regenerate_keys,time_zone) VALUES (v_vm_guid,'vdiaules.uv.es','f','Central European Standard Time');
END IF;
UPDATE vm_static SET is_initialized = 'f' WHERE vm_guid = v_vm_guid;
UPDATE vm_static SET template_version_number=null WHERE vm_guid = v_vm_guid;
IF EXISTS (SELECT device_id FROM vm_device where vm_id = v_vm_guid and device = 'floppy') THEN
RAISE NOTICE 'Not updating, floppy exists';
ELSE
v_uuid := (select uuid_generate_v1());
INSERT INTO vm_device VALUES(v_uuid,v_vm_guid,'disk','floppy','{unit=0, bus=0, target=0, controller=0, type=drive}',0,'{ }');
END IF;
END LOOP;
END; $$ LANGUAGE plpgsql;
SELECT test_func();
DROP FUNCTION test_func();
Verified. build used: engine: rhevm-3.5.0-0.23.beta.el6ev.noarch host: vdsm-4.16.8.1-2.el7ev.x86_64 libvirt-1.1.1-29.el7_0.4.x86_64 sanlock-3.1.0-2.el7.x86_64 qemu-kvm-rhev-1.5.3-60.el7_0.11.x86_64 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2015-0158.html |