- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
IO Limit Disks Bug?
Hello,
I've a script that limits disks io of all VMs. With upgrade to 5.5 Ux, that doesn'nt work anymore.
my $io_alloc = StorageIOAllocationInfo->new (shares => $sharesInfo, limit=> "10");
$device->storageIOAllocation ($io_alloc);
my $virtualDeviceConfigSpec = VirtualDeviceConfigSpec->new (device => $device, operation => VirtualDeviceConfigSpecOperation->new('edit'));
my $vmConfig = VirtualMachineConfigSpec->new (deviceChange => [$virtualDeviceConfigSpec]);
$vm->ReconfigVM (spec => $vmConfig);
I'm getting the following error:
SOAP Fault:
-----------
Fault string: Ein angegebener Parameter war nicht korrekt.
spec.sharesInfo.limit
Why is there any problem with shares?
I think that's a bug. Now I'm unable to set the disk io limit.
Any ideas, tricks oder workarounds?
Thanks!
Regards,
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Don't have the cycles to test, but try the PrimType in case the 5.5 API parser is sensitive to the soap XSD type:
my $io_alloc = StorageIOAllocationInfo->new (shares => $sharesInfo, limit=> PrimType->new(10, 'long'));
$device->storageIOAllocation ($io_alloc);
my $virtualDeviceConfigSpec = VirtualDeviceConfigSpec->new (device => $device, operation => VirtualDeviceConfigSpecOperation->new('edit'));
my $vmConfig = VirtualMachineConfigSpec->new (deviceChange => [$virtualDeviceConfigSpec]);
$vm->ReconfigVM (spec => $vmConfig);
If that doesn't work, I'll see if I can reproduce it in my lab environment, but always possible it's a bug.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Now I'm getting the following error:
Cannot parse "PrimType=HASH(0x3330340)" as a long value
Further ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Looks like it didn't serialize? (assuming your error is coming from the API vs the SDK)
Maybe try to pull it out, then pass it in?
$long_type = PrimType->new(10, 'long');
my $io_alloc = StorageIOAllocationInfo->new (shares => $sharesInfo, limit => $long_type );
$device->storageIOAllocation ($io_alloc);
my $virtualDeviceConfigSpec = VirtualDeviceConfigSpec->new (device => $device, operation => VirtualDeviceConfigSpecOperation->new('edit'));
my $vmConfig = VirtualMachineConfigSpec->new (deviceChange => [$virtualDeviceConfigSpec]);
$vm->ReconfigVM (spec => $vmConfig);
I'll give it a pass later to see what's going on. Shouldn't be seeing the HASH value, should be serialized by the SDK into a proper SOAP XSD value of type 'long'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Also tried that this morning.
Same error ![]()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I took another look at this, I think you added the limit property to your sharesInfo object. The object sharesInfo only has two properties: level & shares. Sorry to spin the thread out in another direction, the problem was actually simpler
I tested it with a proper sharesInfo object and it worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Could you post your solution?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
#!/usr/bin/perl
use strict;
use warnings;
use VMware::VIRuntime;
use Data::Dumper;
Opts::parse();
Opts::validate();
Util::connect();
my $vms = Vim::find_entity_views(
view_type => 'VirtualMachine',
properties => ['config.hardware.device', 'name']
);
my $vm = $vms->[0];
my @disks = grep { $_->isa('VirtualDisk') } @{$vm->{'config.hardware.device'}};
my $disk = $disks[0];
my $sharesInfo = new SharesInfo(
level => new SharesLevel("custom"),
shares => 4000
);
my $io_alloc = StorageIOAllocationInfo->new(
shares => $sharesInfo,
limit => "10"
);
$disk->storageIOAllocation($io_alloc);
my $virtualDeviceConfigSpec = VirtualDeviceConfigSpec->new (device => $disk, operation => VirtualDeviceConfigSpecOperation->new('edit'));
my $vmConfig = VirtualMachineConfigSpec->new (deviceChange => [$virtualDeviceConfigSpec]);
$vm->ReconfigVM (spec => $vmConfig);
print "VM " . $vm->{'name'} . " reconfigured\n";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Which vsphere version are you using?
I've cut&pasted this script 1:1 and again the following error:
SOAP Fault:
-----------
Fault string: Ein angegebener Parameter war nicht korrekt.
spec.sharesInfo.limit
Fault detail: InvalidArgument
My script worked with vsphere 5.1, but with 5.5 (U2 or above) it doesn't - maybe you have 5.1?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm on vSphere 5.5u2d (VCSA Sim)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5.5 U2b (218311) here ...
Strange stuff. Maybe it works with U2d again ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Perhaps, can't say I remember calling it on a specific version.
However, the error you're posting still seems to indicate there is the 'limit' property in the SharesInfo object. You just copied and pasted it in? Perhaps you are using an older VIPerl SDK version (like 5.1)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, newest version (build-2043780)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yeah, not sure. From the error message it seems to be complaining about a property that shouldn't be set on SharesInfo, but if you copy-pasted my example, not sure where it's picking it up or why it's bombing out there. You could add '--verbose' to the script command line and review the XML that's going out. If you post it up I can look at it.