[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-9560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15604730#comment-15604730
 ] 

ASF GitHub Bot commented on CLOUDSTACK-9560:
--------------------------------------------

Github user yvsubhash commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1726#discussion_r84859378
  
    --- Diff: server/src/com/cloud/storage/StorageManagerImpl.java ---
    @@ -2199,15 +2199,20 @@ public void cleanupDownloadUrls(){
                     if(downloadUrlCurrentAgeInSecs < 
_downloadUrlExpirationInterval){  // URL hasnt expired yet
                         continue;
                     }
    -
    -                s_logger.debug("Removing download url " + 
volumeOnImageStore.getExtractUrl() + " for volume id " + 
volumeOnImageStore.getVolumeId());
    +                long volumeId = volumeOnImageStore.getVolumeId();
    +                s_logger.debug("Removing download url " + 
volumeOnImageStore.getExtractUrl() + " for volume id " + volumeId);
     
                     // Remove it from image store
                     ImageStoreEntity secStore = (ImageStoreEntity) 
_dataStoreMgr.getDataStore(volumeOnImageStore.getDataStoreId(), 
DataStoreRole.Image);
                     
secStore.deleteExtractUrl(volumeOnImageStore.getInstallPath(), 
volumeOnImageStore.getExtractUrl(), Upload.Type.VOLUME);
     
                     // Now expunge it from DB since this entry was created 
only for download purpose
                     _volumeStoreDao.expunge(volumeOnImageStore.getId());
    +                Volume volume = _volumeDao.findById(volumeId);
    +                if (volume.getState() == Volume.State.Expunged)
    --- End diff --
    
    @koushik-das Having a null for volume is not a possible scenario as there 
is db level relation ship between volume and volume_store_ref and the id is 
picked up from volume_store_ref. Would you still recommend having a null check 
here?


> Root volume of deleted VM left unremoved
> ----------------------------------------
>
>                 Key: CLOUDSTACK-9560
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9560
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>          Components: Volumes
>    Affects Versions: 4.8.0
>         Environment: XenServer
>            Reporter: subhash yedugundla
>             Fix For: 4.8.1
>
>
> In the following scenario root volume gets unremoved
> Steps to reproduce the issue
> 1. Create a VM.
> 2. Stop this VM.
> 3. On the page of the volume of the VM, click 'Download Volume' icon.
> 4. Wait for the popup screen to display and cancel out with/without clicking 
> the download link.
> 5. Destroy the VM
> Even after the corresponding VM is deleted,expunged, the root-volume is left 
> in 'Expunging' state unremoved.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to