weizhouapache commented on PR #13692:
URL: https://github.com/apache/cloudstack/pull/13692#issuecomment-5615464096

   > @DaanHoogland @Pearl1594
   > 
   > The latest commit has fixed the issue with SystemVM's with fully patched 
xcp-ng 8.3
   > 
   > However, we see certain operations failing
   > 
   > 1. Creating template from volume
   > 2. Create template from snapshot.
   > 
   > Failure seen in the xensource.log on xcp-ng is below
   > 
   > ```
   > Aug 14 12:00:38 ref-trl-12214-x-mol9-prashanth-reddy-xs1 xapi: 
[error||6364 :::80|dispatch:host.call_plugin D:eb5bec0c5ac1|backtrace] 
host.call_plugin R:c6658c7122b8 failed with exception 
Server_error(XENAPI_PLUGIN_FAILURE, [ non-zero exit; ; Traceback (most recent 
call last):\x0A  File "/etc/xapi.d/plugins/vmopsSnapshot", line 34, in 
<module>\x0A    import lvhdutil\x0AModuleNotFoundError: No module named 
'lvhdutil'\x0A ])
   > Aug 14 12:00:38 ref-trl-12214-x-mol9-prashanth-reddy-xs1 xapi: 
[error||6364 :::80|dispatch:host.call_plugin D:eb5bec0c5ac1|backtrace] Raised 
Server_error(XENAPI_PLUGIN_FAILURE, [ non-zero exit; ; Traceback (most recent 
call last):\x0A  File "/etc/xapi.d/plugins/vmopsSnapshot", line 34, in 
<module>\x0A    import lvhdutil\x0AModuleNotFoundError: No module named 
'lvhdutil'\x0A ])
   > ```
   > 
   > I think we need to have guard fix in vmopsSnapshot as well.
   > 
   > Note: this is only fix for xcp-ng 8.3 with SM module reverted. For future 
versions of xcp-ng ( where lvhdutil is removed), we need fix as suggested here 
[#13292 
(comment)](https://github.com/apache/cloudstack/issues/13292#issuecomment-4683013183)
   
   @DaanHoogland 
   I think @prashanthr2 is right, the changes need to be applied on other files 
too
   
   ```
   # git grep lvhdutil
   scripts/vm/hypervisor/xenserver/cloud-plugin-storage:import lvhdutil
   scripts/vm/hypervisor/xenserver/cloud-plugin-storage:        primarySRDir = 
lvhdutil.VG_PREFIX + primaryStorageSRUuid
   scripts/vm/hypervisor/xenserver/cloud-plugin-storage:        return 
os.path.join(lvhdutil.VG_LOCATION, primarySRDir)
   scripts/vm/hypervisor/xenserver/cloud-plugin-storage:        vhdInfo = 
vhdutil.getVHDInfoLVM(lvName, lvhdutil.extractUuid, vgName)
   scripts/vm/hypervisor/xenserver/cloud-plugin-storage:            parentUUID 
= vhdutil.getParent(path, lvhdutil.extractUuid)
   scripts/vm/hypervisor/xenserver/vmopsSnapshot:import lvhdutil
   scripts/vm/hypervisor/xenserver/vmopsSnapshot:        vhdInfo = 
vhdutil.getVHDInfoLVM(lvName, lvhdutil.extractUuid, vgName)
   scripts/vm/hypervisor/xenserver/vmopsSnapshot:            parentUUID = 
vhdutil.getParent(path, lvhdutil.extractUuid)
   scripts/vm/hypervisor/xenserver/vmopsSnapshot:        primarySRDir = 
lvhdutil.VG_PREFIX + primaryStorageSRUuid
   scripts/vm/hypervisor/xenserver/vmopsSnapshot:        return 
os.path.join(lvhdutil.VG_LOCATION, primarySRDir)
   scripts/vm/hypervisor/xenserver/xenserver84/cloud-plugin-storage:import 
lvhdutil
   scripts/vm/hypervisor/xenserver/xenserver84/cloud-plugin-storage:        
primarySRDir = lvhdutil.VG_PREFIX + primaryStorageSRUuid
   scripts/vm/hypervisor/xenserver/xenserver84/cloud-plugin-storage:        
return os.path.join(lvhdutil.VG_LOCATION, primarySRDir)
   scripts/vm/hypervisor/xenserver/xenserver84/cloud-plugin-storage:        
vhdInfo = vhdutil.getVHDInfoLVM(lvName, lvhdutil.extractUuid, vgName)
   scripts/vm/hypervisor/xenserver/xenserver84/cloud-plugin-storage:            
parentUUID = vhdutil.getParent(path, lvhdutil.extractUuid)
   scripts/vm/hypervisor/xenserver/xenserver84/vmopsSnapshot:import lvhdutil
   scripts/vm/hypervisor/xenserver/xenserver84/vmopsSnapshot:        vhdInfo = 
vhdutil.getVHDInfoLVM(lvName, lvhdutil.extractUuid, vgName)
   scripts/vm/hypervisor/xenserver/xenserver84/vmopsSnapshot:            
parentUUID = vhdutil.getParent(path, lvhdutil.extractUuid)
   scripts/vm/hypervisor/xenserver/xenserver84/vmopsSnapshot:        
primarySRDir = lvhdutil.VG_PREFIX + primaryStorageSRUuid
   scripts/vm/hypervisor/xenserver/xenserver84/vmopsSnapshot:        return 
os.path.join(lvhdutil.VG_LOCATION, primarySRDir)
   ```
   
   just a note that these changes only bypass the lvhdutil import issue. 
lvhdutil is still used in some cases, so we may need to further investigate the 
potential impact of not importing it.
   
   ideally, all usage of lvhdutil could eventually be replaced with other 
methods. Perhaps @olivierlambert could provide some advice on this.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to