GutoVeronezi opened a new pull request #5758:
URL: https://github.com/apache/cloudstack/pull/5758


   ### Description
   
   When a volume is copied to another storage pool, if the template does not 
exist in the destination storage pool yet, it should be copied. The API 
`migrateVirtualMachineWithVolume` already does it; however, when migrating the 
volume with `migrateVolume` (VM stopped), the template is not copied, which 
causes inconsistencies in the database and primary storage systems. The not 
existence of the template in the storage pool causes an NPE when using the API 
`migrateVirtualMachineWithVolume`.  
   
   This PR intends to avoid this NPE.
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [x] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [x] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [x] Minor
   - [ ] Trivial
   
   
   ### How Has This Been Tested?
   
   I tested it in a test lab.
   
   1. I created a VM;
   2. I stopped the VM;
   3. I created a new primary storage;
   4. With API `migrateVolume` I migrated the volume to the new primary storage;
   5. Before this changes, when I tried to migrate the volume to another 
primary storage that does not have the template yet, it threw a NPE.
   6. After this changes, when I tried to migrate the volume to another primary 
storage that does not have the template yet, the migration could be done.


-- 
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