Quantcast
Channel: VMware Communities : Discussion List - Virtual Disk Development Kit
Viewing all articles
Browse latest Browse all 2039

How can I add a storage policy to a VDC?

$
0
0


Can someone please advise how I can add a new storage policy to an existing VDC? I've got this code snippet that doesn't work. It throws an exception that parameter 'source' is required.


 


                            ReferenceType referenceType = GetProviderVdcRef(out errorMessage);
                            ProviderVdc providerVdc = ProviderVdc.GetProviderVdcByReference(_client, referenceType);
                            List<ReferenceType> providerVdcStorageProfiles = providerVdc.GetProviderVdcStorageProfileRefs();


                            ReferenceType providerVdcStorageProfileRef = providerVdc.GetProviderVdcStorageProfileRefs().FirstOrDefault(o => o.name.ToLower() == "nfs01");


                            VdcStorageProfileParamsType vdcStorageProfile = new VdcStorageProfileParamsType();
                            vdcStorageProfile.Enabled = true;
                            vdcStorageProfile.Default = true;
                            vdcStorageProfile.Limit = 10000;
                            vdcStorageProfile.Units = "MB";
                            vdcStorageProfile.ProviderVdcStorageProfile = providerVdcStorageProfileRef;


                            List<VdcStorageProfileParamsType> VdcStorageProfileParamsTypeList = new List<VdcStorageProfileParamsType>();
                            VdcStorageProfileParamsTypeList.Add(vdcStorageProfile);


                            adminVdc.UpdateAdminVdcStorageProfiles(VdcStorageProfileParamsTypeList, providerVdcStorageProfiles);


 


And I have no clue where that parameter is or being set.


 


Thanks in advance


Viewing all articles
Browse latest Browse all 2039

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>