<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Prevent VM from being deleted in vSphere Management SDK Discussions</title>
    <link>https://communities.vmware.com/t5/vSphere-Management-SDK/Prevent-VM-from-being-deleted/m-p/1606605#M8502</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have Role\Responsibilities set that way we want.&amp;nbsp; However, we have a need for flagging a specific VM as PROTECTED, so that any user, Enterprise admin or other would not be able to delete without first removing that flag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, a Root Certificate Authority best practice is to have the Root CA powered down during most of the year.&amp;nbsp; Only a few times during the year would you bring the Root CA up for maintenance for a few hours while changing keys.&amp;nbsp; For this reason, this VM will be powered down 99.99% of the time and we would like to flag it so that no-one can delete it without first removing that flag.&amp;nbsp; This is similar to the boolean value that protects Active Directory accounts from being deleted inadvertantly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was hoping that there would be some variable you can manually enter on the .vmx file that would protect the VM from being deleted.&amp;nbsp; Does anyone know of such a feature\flag?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Nov 2011 17:39:16 GMT</pubDate>
    <dc:creator>macejh1</dc:creator>
    <dc:date>2011-11-28T17:39:16Z</dc:date>
    <item>
      <title>Prevent VM from being deleted</title>
      <link>https://communities.vmware.com/t5/vSphere-Management-SDK/Prevent-VM-from-being-deleted/m-p/1606596#M8493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to find out if there is a way to prevent a VM from being 'Removed from Inventory' or 'Delete from Disk'. When I am running my code on a VM i don't want the user to be able to delete it. I have a CustomTask associated with the VM and there is a field in &lt;A href="http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.TaskInfo.html"&gt;TaskInfo&lt;/A&gt; called locked. Does anyone know how to set the locked field or even if that will fix my problem.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Nov 2009 20:24:42 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Management-SDK/Prevent-VM-from-being-deleted/m-p/1606596#M8493</guid>
      <dc:creator>scott21</dc:creator>
      <dc:date>2009-11-12T20:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent VM from being deleted</title>
      <link>https://communities.vmware.com/t5/vSphere-Management-SDK/Prevent-VM-from-being-deleted/m-p/1606597#M8494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This sounds like a great use of 'Roles' and 'Permissions' which can be customized so that a user can manage his/her VM without the ability to delete/remove a VM, you'll need vCenter to implement this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=========================================================================&lt;/P&gt;&lt;P&gt;William Lam&lt;/P&gt;&lt;P&gt;VMware vExpert 2009&lt;/P&gt;&lt;P&gt;VMware ESX/ESXi scripts and resources at: &lt;A href="http://engineering.ucsb.edu/~duonglt/vmware/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://twitter.com/lamw"&gt;Twitter: @lamw&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/d-9852"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/d-10878"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/d-10837"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/c-3164"&gt;VMware Code Central - Scripts/Sample code for Developers and Administrators&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/c-2828"&gt;VMware Developer Comuunity&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://engineering.ucsb.edu/~duonglt/vmware/vexpert_silver_icon.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you find this information useful, please award points for "correct" or "helpful".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Nov 2009 22:32:03 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Management-SDK/Prevent-VM-from-being-deleted/m-p/1606597#M8494</guid>
      <dc:creator>lamw</dc:creator>
      <dc:date>2009-11-12T22:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent VM from being deleted</title>
      <link>https://communities.vmware.com/t5/vSphere-Management-SDK/Prevent-VM-from-being-deleted/m-p/1606598#M8495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want the user to be able to delete/remove the VM. I just don't want them to be able to do it when i am running a task on it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example: If you do a clone on a VM. It changes the VM you are cloning to not allow you to delete or remove it until the clone has finished. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2009 15:03:21 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Management-SDK/Prevent-VM-from-being-deleted/m-p/1606598#M8495</guid>
      <dc:creator>scott21</dc:creator>
      <dc:date>2009-11-13T15:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent VM from being deleted</title>
      <link>https://communities.vmware.com/t5/vSphere-Management-SDK/Prevent-VM-from-being-deleted/m-p/1606599#M8496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This all depends on the operation you're performing, in a clone, yes the VM object will be locked from making any changes to. afaik, the &lt;STRONG&gt;Locked&lt;/STRONG&gt; field is not something you can set but done internally within the APIs, if you take a look at the description, it says the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the state of the task is "running", then this property is a list of managed entities that the operation has locked, with a shared lock. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This property is primarily set based on the entities being modified and if the task is in a 'running' state. If you operation requires a lock, then it will not allow a user to remove/delete. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Probably be a good idea to have some type of communication with your customers or even setup change control so you don't run into this problem ... if it's actually occurring. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=========================================================================&lt;/P&gt;&lt;P&gt;William Lam&lt;/P&gt;&lt;P&gt;VMware vExpert 2009&lt;/P&gt;&lt;P&gt;VMware ESX/ESXi scripts and resources at: &lt;A href="http://engineering.ucsb.edu/~duonglt/vmware/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://twitter.com/lamw"&gt;Twitter: @lamw&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/d-9852"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/d-10878"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/d-10837"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/c-3164"&gt;VMware Code Central - Scripts/Sample code for Developers and Administrators&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/c-2828"&gt;VMware Developer Comuunity&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://engineering.ucsb.edu/~duonglt/vmware/vexpert_silver_icon.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you find this information useful, please award points for "correct" or "helpful".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2009 15:32:37 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Management-SDK/Prevent-VM-from-being-deleted/m-p/1606599#M8496</guid>
      <dc:creator>lamw</dc:creator>
      <dc:date>2009-11-13T15:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent VM from being deleted</title>
      <link>https://communities.vmware.com/t5/vSphere-Management-SDK/Prevent-VM-from-being-deleted/m-p/1606600#M8497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So the only way to prevent a deletion is change user permissions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2009 17:00:57 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Management-SDK/Prevent-VM-from-being-deleted/m-p/1606600#M8497</guid>
      <dc:creator>scott21</dc:creator>
      <dc:date>2009-11-13T17:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent VM from being deleted</title>
      <link>https://communities.vmware.com/t5/vSphere-Management-SDK/Prevent-VM-from-being-deleted/m-p/1606601#M8498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm saying if you don't want a user to delete/remove a VM, the permissions is the way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding your 'custom process' ... if the operation is something that would prevent someone from deleting an entity, it'll be implemented by VMware by default internally... I don't think you have control over that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can describe what you're doing, perhaps we can help shed more light. Again, in the simplest scenario if you perform say a CloneVM_Task() operation using the SDK, then the VM object will be locked and no one will be able to delete/remove until it's completed. You don't need to do anything extra ... it would be the same if you were performing a ReconfigVM_Task(), the VM entity would be lock until the change has completed. Do you get what I'm saying? So I'm not exactly clear on what operation you're performing that would allow a user to delete the object, again this is handled internally &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=========================================================================&lt;/P&gt;&lt;P&gt;William Lam&lt;/P&gt;&lt;P&gt;VMware vExpert 2009&lt;/P&gt;&lt;P&gt;VMware ESX/ESXi scripts and resources at: &lt;A href="http://engineering.ucsb.edu/~duonglt/vmware/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://twitter.com/lamw"&gt;Twitter: @lamw&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/d-9852"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/d-10878"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/d-10837"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/c-3164"&gt;VMware Code Central - Scripts/Sample code for Developers and Administrators&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/c-2828"&gt;VMware Developer Comuunity&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://engineering.ucsb.edu/~duonglt/vmware/vexpert_silver_icon.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you find this information useful, please award points for "correct" or "helpful".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2009 17:35:43 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Management-SDK/Prevent-VM-from-being-deleted/m-p/1606601#M8498</guid>
      <dc:creator>lamw</dc:creator>
      <dc:date>2009-11-13T17:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent VM from being deleted</title>
      <link>https://communities.vmware.com/t5/vSphere-Management-SDK/Prevent-VM-from-being-deleted/m-p/1606602#M8499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well the problem is that during my custom task is not doing a vmware task. So the VM will not be locked. I am creating a Custom Task that is associated with a VM object. I start the task and it says 'In Progress'. Then I delete the VM that the Custom Task is associated with and can no longer update the Custom Task. So I have created an orphaned Custom Task. To prevent this I was going to prevent the VM from being deleted/removed while I am running a custom task on it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think using permissions is going to work in this case. I only want that one VM to be locked and I want it to be locked for every user that has access to that vCenter. I also only want it locked during the Custom Task. I have not used permissions but is it possible to do this ? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2009 18:22:38 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Management-SDK/Prevent-VM-from-being-deleted/m-p/1606602#M8499</guid>
      <dc:creator>scott21</dc:creator>
      <dc:date>2009-11-13T18:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent VM from being deleted</title>
      <link>https://communities.vmware.com/t5/vSphere-Management-SDK/Prevent-VM-from-being-deleted/m-p/1606603#M8500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm still not quite sure I understand your use case .. or what 'custom task' you're performing. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I am creating a Custom Task that is associated with a VM object. I start the task and it says 'In Progress'. Then I delete the VM that the Custom Task is associated with and can no longer update the Custom Task&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;??? sounds like you're just deleting the VM ???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again if you know which VM and no one else should have permission then you should use roles/permissions to not allow anyone else but you to delete or update. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=========================================================================&lt;/P&gt;&lt;P&gt;William Lam&lt;/P&gt;&lt;P&gt;VMware vExpert 2009&lt;/P&gt;&lt;P&gt;VMware ESX/ESXi scripts and resources at: &lt;A href="http://engineering.ucsb.edu/~duonglt/vmware/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://twitter.com/lamw"&gt;Twitter: @lamw&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/d-9852"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/d-10878"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/d-10837"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/c-3164"&gt;VMware Code Central - Scripts/Sample code for Developers and Administrators&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/c-2828"&gt;VMware Developer Comuunity&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://engineering.ucsb.edu/~duonglt/vmware/vexpert_silver_icon.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you find this information useful, please award points for "correct" or "helpful".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Nov 2009 02:43:00 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Management-SDK/Prevent-VM-from-being-deleted/m-p/1606603#M8500</guid>
      <dc:creator>lamw</dc:creator>
      <dc:date>2009-11-14T02:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent VM from being deleted</title>
      <link>https://communities.vmware.com/t5/vSphere-Management-SDK/Prevent-VM-from-being-deleted/m-p/1606604#M8501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd follow Iamw's recommendation and define roles and permissions.  I'd also get a regular backup process implemented on the VMDKs (VCB or some 3rd party VMDK aware product).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think there will be much else you can do outside of custom roles and permissions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Nov 2009 18:08:54 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Management-SDK/Prevent-VM-from-being-deleted/m-p/1606604#M8501</guid>
      <dc:creator>stumpr</dc:creator>
      <dc:date>2009-11-15T18:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent VM from being deleted</title>
      <link>https://communities.vmware.com/t5/vSphere-Management-SDK/Prevent-VM-from-being-deleted/m-p/1606605#M8502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have Role\Responsibilities set that way we want.&amp;nbsp; However, we have a need for flagging a specific VM as PROTECTED, so that any user, Enterprise admin or other would not be able to delete without first removing that flag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, a Root Certificate Authority best practice is to have the Root CA powered down during most of the year.&amp;nbsp; Only a few times during the year would you bring the Root CA up for maintenance for a few hours while changing keys.&amp;nbsp; For this reason, this VM will be powered down 99.99% of the time and we would like to flag it so that no-one can delete it without first removing that flag.&amp;nbsp; This is similar to the boolean value that protects Active Directory accounts from being deleted inadvertantly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was hoping that there would be some variable you can manually enter on the .vmx file that would protect the VM from being deleted.&amp;nbsp; Does anyone know of such a feature\flag?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2011 17:39:16 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Management-SDK/Prevent-VM-from-being-deleted/m-p/1606605#M8502</guid>
      <dc:creator>macejh1</dc:creator>
      <dc:date>2011-11-28T17:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent VM from being deleted</title>
      <link>https://communities.vmware.com/t5/vSphere-Management-SDK/Prevent-VM-from-being-deleted/m-p/2958409#M14768</link>
      <description>&lt;P&gt;please tell me this is done somewhere by now&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2023 23:19:01 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Management-SDK/Prevent-VM-from-being-deleted/m-p/2958409#M14768</guid>
      <dc:creator>avenonet</dc:creator>
      <dc:date>2023-03-08T23:19:01Z</dc:date>
    </item>
  </channel>
</rss>

