-
Notifications
You must be signed in to change notification settings - Fork 1.3k
volume resize: Fix issue with volume resize on VMWare (deploy as-is templates) #4829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
26bbc1a
8b93bb2
5169c0c
f0a3d6e
1c3fc3c
8480cde
4eda67e
3a05c9b
08faa04
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,6 +49,8 @@ | |
| import javax.xml.parsers.ParserConfigurationException; | ||
|
|
||
| import com.cloud.agent.api.to.deployasis.OVFPropertyTO; | ||
| import com.cloud.api.query.dao.ServiceOfferingJoinDao; | ||
| import com.cloud.api.query.vo.ServiceOfferingJoinVO; | ||
| import com.cloud.deployasis.UserVmDeployAsIsDetailVO; | ||
| import com.cloud.deployasis.dao.UserVmDeployAsIsDetailsDao; | ||
| import com.cloud.exception.UnsupportedServiceException; | ||
|
|
@@ -514,6 +516,8 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir | |
| private UserVmDeployAsIsDetailsDao userVmDeployAsIsDetailsDao; | ||
| @Inject | ||
| private StorageManager storageMgr; | ||
| @Inject | ||
| private ServiceOfferingJoinDao serviceOfferingJoinDao; | ||
|
|
||
| private ScheduledExecutorService _executor = null; | ||
| private ScheduledExecutorService _vmIpFetchExecutor = null; | ||
|
|
@@ -5266,9 +5270,21 @@ public UserVm createVirtualMachine(DeployVMCmd cmd) throws InsufficientCapacityE | |
| throw new InvalidParameterValueException("Unable to use template " + templateId); | ||
| } | ||
|
|
||
| // Bootmode and boottype are not supported on VMWare dpeloy-as-is templates (since 4.15) | ||
| if (template.isDeployAsIs() && (cmd.getBootMode() != null || cmd.getBootType() != null)) { | ||
| throw new InvalidParameterValueException("Boot type and boot mode are not supported on VMware, as we honour what is defined in the template."); | ||
| ServiceOfferingJoinVO svcOffering = serviceOfferingJoinDao.findById(serviceOfferingId); | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Pearl1594 is it possible to move all the checks after
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sureshanaparti done
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. checked, looks good now. |
||
| if (template.isDeployAsIs()) { | ||
| if (svcOffering != null && svcOffering.getRootDiskSize() != null && svcOffering.getRootDiskSize() > 0) { | ||
| throw new InvalidParameterValueException("Failed to deploy Virtual Machine as a service offering with root disk size specified cannot be used with a deploy as-is template"); | ||
| } | ||
|
|
||
| if (cmd.getDetails().get("rootdisksize") != null) { | ||
| throw new InvalidParameterValueException("Overriding root disk size isn't supported for VMs deployed from defploy as-is templates"); | ||
| } | ||
|
|
||
| // Bootmode and boottype are not supported on VMWare dpeloy-as-is templates (since 4.15) | ||
| if ((cmd.getBootMode() != null || cmd.getBootType() != null)) { | ||
| throw new InvalidParameterValueException("Boot type and boot mode are not supported on VMware, as we honour what is defined in the template."); | ||
| } | ||
| } | ||
|
|
||
| Long diskOfferingId = cmd.getDiskOfferingId(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Pearl1594 is this required for ISO as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sureshanaparti It's not required for ISO , have made the necessary change.