diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index 6aca4a8d044..9844bb7c2af 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -2091,8 +2091,11 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati List detailsVO = null; if (details != null) { - // Check if the user has passed the gpu-type before passing the VGPU type - if (!details.containsKey(GPU.Keys.pciDevice.toString()) || !details.containsKey(GPU.Keys.vgpuType.toString())) { + // To have correct input, either both gpu card name and VGPU type should be passed or nothing should be passed. + // Use XOR condition to verify that. + boolean entry1 = details.containsKey(GPU.Keys.pciDevice.toString()); + boolean entry2 = details.containsKey(GPU.Keys.vgpuType.toString()); + if ((entry1 || entry2) && !(entry1 && entry2)) { throw new InvalidParameterValueException("Please specify the pciDevice and vgpuType correctly."); } detailsVO = new ArrayList();