Cannot remove vmotion portgroup - "ongoing resource of use"

Hi all

I need to remove the portgroup vmware a vswitch without touching the other exchanges. The vmware portgroup is subsequently added to a new vSwitch.

When I run the command, I get an error that the resource is in use.

The host is:

  • ESXi 4.1 U1
  • In maintenance mode
  • Restarted
  • Does not contain virtual machines.
  • Can be removed successfully with vSphere Client

Get-VMHost | Get-VirtualPortGroup-name "vmotion" | Delete-VirtualPortGroup-confirm: $false
Delete-VirtualPortGroup: 2011-08-24 17:01:11 VirtualPortGroup remove the "vmotion" resource is in use.
On line: 1 char: 76
+ Get-VMHost | Get-VirtualPortGroup-name "vmotion" | Delete-VirtualPortGroup < < < <-confirm: $false
+ CategoryInfo: NotSpecified: (:)) [remove-VirtualPortGroup], ResourceInUse)
+ FullyQualifiedErrorId: Client20_MoServiceImpl_Invoke_ViError, VMware.VimAutomation.ViCore.Cmdlets.Commands.RemoveVirtualPortGroup

Any suggestions?

Thank you

/ Björn

Hello.

Thanks for posting this question, I had also the need to complete the same task today.

I posted my final script I found to work in ESX v4.1 Update 1.

It is basic and annotated for the community to work with in their scripts.

#Connect to server
Write-Host "Connecting to server"
Connect-VIServer -Server 192.168.1.199 -User root -Password Pa55w0rd | Out-Null

Write-Host "Retrieving server details"

#Retrieve the host details
$esxhost = Get-VMHost -Name "192.168.1.199"

#Set Port Group to look for (case sensitive)
$PGName = "vmotion" 

Write-Host "Looking for vmk NIC assigned to vmotion"
#Look for the vmk NIC for vmotion
$vmkNic = Get-VMHostNetworkAdapter -VMHost $esxhost | where {$_.PortgroupName -eq $PGName}
Write-Host "Deleting vmk NIC assigned to vmotion"
#Remove the vmk NIC for vmotion, once removed it becomes a normal Port Group from a VMKernel one.
Remove-VMHostNetworkAdapter -Nic $vmkNic -Confirm:$false |Out-Null
#Set a couple variables
$redundantpg = "vmotion"

Write-Host "Removing vmotion Port Group"
#Retrieve the vmotion Port Group details
$defaultvpg = Get-VirtualPortGroup -Name $redundantpg

#Remove the vmotion Port Group
Remove-VirtualPortGroup -VirtualPortGroup $defaultvpg -Confirm:$false |Out-Null

Write-Host "Disconnecting from server"
#Disconnect from the server
Disconnect-VIServer -Server 192.168.1.199 -Confirm:$false

What I've noticed, is that I had to use the switch -VirtualPortGroup instead of -name to remove VirtualPortGroup

Kind regards

Darren

@dawoo

Tags: VMware

Similar Questions

  • Cannot remove any Dungeon now bytes not used to message cannot find C:\windows\system 32------rundll 32 exe

    Original title: t hink I deleted add remove program,.

    t hink I deleted add remove program, computer guard me tellin memory full, cannot remove no matter what now bytes unused Dungeon is message cannot find C:\windows\system 32------rundll 32. exe does anyone know what this means and how I can now delete files and programs to make more room, comp is need a cleanup and don't know what to do, any help would be received with gratitude xx

    Hi Juleskk,

    Follow the suggestions below for a possible solution:

    Method 1: You can try the steps in the article mentioned below and check.

    Cannot find the Rundll32.exe file when you open Control Panel

    http://support.Microsoft.com/kb/812340

     

    Method 2: I also suggest that you scan your computer with the Microsoft Security Scanner, which would help us to get rid of viruses, spyware and other malicious software.

    The Microsoft Security Scanner is a downloadable security tool for free which allows analysis at the application and helps remove viruses, spyware and other malware. It works with your current antivirus software.

     

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

     

    Note: The Microsoft Safety Scanner ends 10 days after being downloaded. To restart a scan with the latest definitions of anti-malware, download and run the Microsoft Safety Scanner again.

    Important: While hard disk analysis if bad sectors are found when scanning try to repair this area, all available on which data can be lost.

    Method 3: Try the SFC (System File Checker) scan on the computer.

    To run the System File Checker tool, follow these steps:

    a. click Startand type cmd in the box start the search .

    b. right click on cmd in the list programs, and then click run as administrator.

    c. If you are prompted for an administrator password or a confirmation, type your password or click on continue

    d. at the command prompt, the following line and press ENTER:

    sfc/scannow

    See also:

    Description of Windows XP and Windows Server 2003 System File Checker (Sfc.exe)

    http://support.Microsoft.com/kb/310747

     

    File system (CFS) Checker

    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/system_file_checker.mspx?mfr=true

    Let us know if that helps.

  • Storage VMotion failed - LUN "Ongoing resource of use"

    I had a VM, sitting on an oversized LUN, so I reduced the size of the LUN.  The result is a corrupt VMDK.  It's nice that I can rebuild not the end of the world.  The problem is that when I right click on the virtual machine, that it only allows me to "Migration complete" - I can't delete the virtual machine.  If I select a full Migration it will fail to 33% with the error "the virtual disk is either corrupt or not a format supported."  If I tried to remove the source LUN or destination LUN I get an error "resource is in use.  So my question is how do I get rid of this virtual machine and these LUNS so I can start again.

    I'm on ESX 3.5 U4 on CF to FAS2020. Let me know if you need more information.  Thanks for any help!

    Always disconnect shows upward in the inventory.  This part of a cluster?  Disconnect the server. Remove the host ESX to vCenter.  Then, add it in.  Sometimes, remove the server from the cluster is enough, but you may need to remove the vCenter server.

    -KjB

    VMware vExpert

  • Cannot remove CPTL file from the desktop using Vista

    Hi all

    I can't file CPTL remove office by using Vista. Explorer crashes. It is a Captivate 2 file.

    I tried (with no luck):
    -logging in as a different user and delete the file.
    -l' Explorer running as administrator
    -uninstall of Captivate.

    Anyone got any ideas?

    See you soon,.

    Garnett

    Hi Aaron,

    I tried all your suggestions but not in the same order! The last thing I tried before posting here was to uninstall Captivate and I was still unable to delete the file (or rename). After uninstall AND restart the machine, I was still unable to delete the file, BUT I managed to rename the file (including the extension) and delete the file!

    Thanks for getting back to me. It's a strange!

    See you soon,.

    Garnett

  • How to use the del command or any other to ignore files that it cannot remove (files in use) and continue to delete other files in a folder?

    I want to do a batch tha clean windows Temp folder. For this, I tried the del command, but the problem is to stop the deletion of files when it cannot remove a file in use. I want that he skip this file and continue to delete the other files too. I hope you guessed it. Please help me.

    Hello

    Thanks for posting your question in the Microsoft Community.

    The question you posted would be better suited in the MSDN Community.
    http://social.msdn.Microsoft.com/forums/en-us/categories

  • vShield Manager cannot remove portgroup

    I have problem with vCloud Director 1.5. When I stop TIME it has this error.

    -vShield Manager cannot remove portgroup dvportgroup-8446 on DVS dvs-7564

    HTTP/1.1 500 Internal Server Error

    Code: 100, Description: VC connection error: error connecting to vCenter server allocation. ; nested exception is java.util.concurrent.ExecutionException: com.vmware.vim.binding.vim.fault.VimFault com.vmware.vim.binding.vim.fault.InvalidLogin:inherited:

    inherited from com.vmware.vim.binding.vim.fault.InvalidLogin: could not complete the connection due to an incorrect user name or password.

    That said I worng usename and password but I don't change password. I don't know why. A few days before everything works ok. I can start and stop TIME normally. But today this error.

    Thank you for help me alots.

    have you tried to go to your manage & Monitor tab and then access your vcenter and see if there are errors in saying vsphield id inaccessible. If there ar enone, you could try reconnecting to vcenter and also specify the credentials for vshield manager. And then you try to do the task.

  • I am trying to remove a price in pdf format, and a message appears "all or part of the selection has no available police." Cannot add or delete the current font using". I downloaded this font in my Adobe fonts, but still no luck.

    I am trying to remove a price in pdf format, and a message appears "all or part of the selection has no available police." Cannot add or delete the current font using". I downloaded this font in my Adobe fonts, but still no luck.

    How to update or download all the fonts in my Adobe Adobe Acrobat X Pro?

    Get the police does not always help, but to use a font you don't add it to Acrobat. Add you on Mac or Windows.

  • Help! Cannot remove datastore - 'in service '.

    I tried all the suggestions there and still cannot delete a data store in my vCenter.

    (I was not able to restart the hosts, or even put them in maintnenace - is not an option at the moment).

    2-

    I did the following:

    -migrated all VM.

    -checked the vmx files all references to the data store

    -2 VMS found not in the inventory or under tension, which reference the data store - changed those

    -delete the folder .dvsData of the data store

    N ' is not used for HA (2 guests are not in a cluster)

    -made sure the IO control is disabled on all hosts

    -even chained: VMware experience before: how to disable the control of i/o storage for an unavailable data store

    -No snapshots exist on any virtual machine that * have * on this data store

    -also checked for orphans * - 00000x.vmdk on the migrated virtual machine - there is

    -disassemble the data store

    -It works from a host, but not the other.

    -disassembly of host1 gives the Red 'X' on ' there is no virtual machine (all others are green).

    -host2 disassembly disassemble the datastore on host2 but it always displays mounted on host1

    -remove the data store (whether or not they are mounted) fails with the error "current resource of use"

    SUCCESS!

    I wanted to say that I did restart services.sh since a SSH session.

    It does not work.

    Then I noticed I could remove, choose disassemble it a session directly to host2, but always without success.

    I went back to vCenter and got the red X on 'active VM' as soon as I tried to take it apart by the same host (Yes... Ah... the host will allow me to choose the unmount, but vCenter isn't... hmmm).

    I restarted the server vCenter, and Orient the data before vCenter services store could begin.

    Not sure if restarting vCenter did the trick, or disassembly and removal * before * vCenter services could begin did the trick.

    THANKS A LOT FOR YOUR HELP!

    ANSWER:

    OP, do all these things.

    -Check the process opened using this:

    vsish EI ls/storage/scsifw/devices /<"naa. id="" of="" your="" datastore"="">/worlds/ | sed ' s: /:' | while read i; do ps | grep $i; done

    -Restart management on one or more hosts agents: services.sh reboot

    -Restart the server vCenter (or at the very least, restart the services of vCenter).

    At some point in this list, you should be able to dismantle and remove the data store.

  • Cannot remove dumpfile created volume vmfs - 5.5

    I have a 5.5 with only local storage server I recently upgraded to 5.1.

    A few days ago I had inventoried all my VM folders on the next partition:

    / vmfs/volumes/comments.

    Today, when cleaning latest virtual machines, I find the following:

    /vmfs/volumes/guest/vmkdump/44454C4C-4400-1048-805A-C7C04F4C4631.dumpfile

    I don't know what created this... I understand there dumpfiles that can be created on PSODs, but I can't find any reference to a real folder called "vmkdump."

    When I try to delete it, I get the following:

    / vmfs/volumes/524f80a6-f18c10c7-2 c 16-001e4f204bc4/vmkdump # rm - rf 44454C4C-4400-1048-805 a - C7C04F4C4631.dumpfile

    RM: cannot remove ' 44454C4C-4400-1048-805 a - C7C04F4C4631.dumpfile': device or resource busy

    I looked at various KBs and I can't understand it:

    -lsof does not list this file or directory

    -all virtual machines have been cut (maintenance mode)

    -the server has been restarted several times

    I found the following info that may be useful:

    VMkernel.log shows (apparently at the start):

    VMkernel.log:2013 - 10-17 T 03: 13:28.048Z cpu3:70444) FS3: 196: START 44454C4C-4400-1048-805 a - C7C04F4C4631.dumpfile >

    VMkernel.log:2013 - 10-17 T 03: 13:28.048Z cpu3:70444) FS3: 198: END 44454C4C-4400-1048-805 a - C7C04F4C4631.dumpfile >

    VMkernel.log:2013 - 10-17 T 03: 17:10.392Z cpu6:70981) FS3: 196: START 44454C4C-4400-1048-805 a - C7C04F4C4631.dumpfile >

    VMkernel.log:2013 - 10-17 T 03: 17:10.392Z cpu6:70981) FS3: 198: END 44454C4C-4400-1048-805 a - C7C04F4C4631.dumpfile >

    VMkernel.log:2013 - 10-17 T 03: 33:22.900Z cpu0:73786) FS3: 196: START 44454C4C-4400-1048-805 a - C7C04F4C4631.dumpfile >

    VMkernel.log:2013 - 10-17 T 03: 33:22.900Z cpu0:73786) FS3: 198: END 44454C4C-4400-1048-805 a - C7C04F4C4631.dumpfile >

    VMkernel.log:2013 - 10-17 T 03: 40:31.233Z cpu7:75668) FS3: 196: START 44454C4C-4400-1048-805 a - C7C04F4C4631.dumpfile >

    VMkernel.log:2013 - 10-17 T 03: 40:31.233Z cpu7:75668) FS3: 198: END 44454C4C-4400-1048-805 a - C7C04F4C4631.dumpfile >

    VMkernel.log:2013 - 10-17 T 03: 41:25.409Z cpu3:75805) FS3: 196: START 44454C4C-4400-1048-805 a - C7C04F4C4631.dumpfile >

    VMkernel.log:2013 - 10-17 T 03: 41:25.409Z cpu3:75805) FS3: 198: END 44454C4C-4400-1048-805 a - C7C04F4C4631.dumpfile >

    VMkernel.log:2013 - 10-17 T 04: 36:02.444Z cpu3:36299) FS3: 196: START 44454C4C-4400-1048-805 a - C7C04F4C4631.dumpfile >

    VMkernel.log:2013 - 10-17 T 04: 36:02.444Z cpu3:36299) FS3: 198: END 44454C4C-4400-1048-805 a - C7C04F4C4631.dumpfile >

    Also, I get the following with vmkfstools result:

    / vmfs/volumes/524f80a6-f18c10c7-2 c 16-001e4f204bc4/vmkdump # vmkfstools d 44454C4C-4400-1048-805 a - C7C04F4C4631.dumpfile

    Lock [type 10 c 00001 compensate 206995456 v 2409, hb offset 3920384

    GEN 27, mode 1, owner 525f6851-c5108b26 -001e4f204bc4 mtime ce23 - 645

    [num 0 gblnum 0 gblgen 0 gblbrk 0]

    < 4, 465, 104 > addr gen 2238, links 1, type reg, flags 0, uid 0, gid 0, mode 100666

    Len 166723584, n. b. 159 tbz 0, 0, newSinceEpoch 159 cow, mrz 1, bs 1048576

    According to KB 10051, the number of updates in bold above is intended to indicate the MAC address of the owner of the lock.  Which makes absolutely no sense to me, that's the address, it belongs to the second internal NETWORK card in this system:

    list/vmfs/volumes/524f80a6-f18c10c7-2 c 16-001e4f204bc4/vmkdump # esxcli network nic

    Name PCI Device Driver link speed Duplex MAC address MTU Description

    ------  -------------  ------  ----  -----  ------  -----------------  ----  -------------------------------------------------------------

    vmnic0 bnx2 up to 1000 Full 00:1e:4f:20:4 b 0000:003:00.0: c2 1500 Broadcom Broadcom NetXtreme II BCM5708 1000Base-T Corporation

    vmnic1 bnx2 0000:007:00.0 half low 0 00:1e:4f:20:4 b: c4 1500 Broadcom Broadcom NetXtreme II BCM5708 1000Base-T Corporation

    As you can see that this NETWORK adapter is in down state... it is not plugged in and has never been used (recently) for anything.

    EDIT - Holy coincidence Batman!  It seems that the Mac address of my second card happens to match exactly the last UUID of some of VMFS volumes section!

    / vmfs/volumes # esxcli list of file system storage

    Mount a Volume mounted UUID Type size free name

    -------------------------------------------------  -----------  -----------------------------------  -------  ------  -------------  -------------

    / vmfs/volumes/524f80a6-f18c10c7-2 c 16-001e4f204bc4 invited true VMFS of the 524f80a6-f18c10c7-16-001e4f204bc4-5 1999038840832 2 c 1153078132736

    swap/vmfs/volumes/5250f9ba-1c2084a1-ccc8-001e4f204bc4 5250f9ba-1c2084a1-ccc8-001e4f204bc4 true VMFS-5 493384368128 492335792128

    / vmfs/volumes/52583d 27-570697be-161 b - 001e4f204bc4 52583 d 27-570697be-161 b - real 001e4f204bc4 4293591040 4161273856 vfat

    / vmfs/volumes/d789b775-b425486f-ac6f-1a3cee25ec3d d789b775-b425486f-ac6f-1a3cee25ec3d true 261853184 13754368 vfat

    / vmfs/volumes/492adf74-59b63f60-76FA-01385be4c120 492adf74-59b63f60-76fa-01385be4c120 true 261853184 97005568 vfat

    / vmfs/volumes/506469eb-d746eb51-3D 506469eb-d746eb51 - 3 d 04-001e4f204bc4 04-001e4f204bc4 true 299712512 99147776 vfat

    If the NIC information above seem to be a loophole... and the owner of the directory in question seems to be simply the volume itself (?)

    I'm worried because not only I want to remove this file from my store of data (or at least understand the need for it), but because of the small cryptic information that I can see so far I don't think that sounds a coredump is / was being created.

    To the best of my knowledge, this system has no other problems, it starts very well and apart from some other errors not apparent, miners, I saw in newspapers, I know not what could be the cause.

    Advice is very welcome as to what is happening!

    Yes NightWing... the coredump file is 5.5

    Size of the system increases lead to larger ESXi unannounced dumps core. The partition of coredump for new installations of ESXi 5.5 is 2.5 GB. For upgrades from previous versions of ESXi 5.5, the core dump partition is limited to 100 MB for ESXi crashes. For many large systems, this limit is not enough space and dump logs are truncated. The limit has an impact on the ability of triage ESXi system issues and the core.

    Updates with limits on partitions of 100 MB, during the boot process, the system might create a dump file. If it does not create a dump file, you can create it manually with the command of file coredump esxcli system.

    The partition which added isn't the vmfs partition, but since the partition created during installation esxi coredump.

    No, you can not have created /vmkdump if you do not have a coredump in vmfs.

    If you think, that your esxi broke down somewhere, look at/var/core... If any coredump is, your Inbox may have thrown some time, otherwise you're good to go.

    In addition, in the case of vmfs partition coredump configured, once you have deleted the file, a new file will be in place if and only if your box has panicked and dumped core.

    Documentation Centre of vSphere 5.5

  • Cannot remove data VMDK file store

    Hello

    I tried to solve a problem where we can't delete the 2 files hard below (since a ls - la in ssh)

    -rw - 1 root root 262144 Jul 31 13:55 2010 - 10 a-000001 - delta.vmdk
    -rw - 1 root root 133711265792 Jul 31 13:55 2010-10A - s001.vmdk

    I tried a rm without success:

    The virtual machine is more listed in VCentre (I tried to delete data store manager), I believe that files can be locked for a reason, but I don't know enough to determine whether it is safe to kill the s pid which seem to use the folder:

    [MS root@ESX1 server demo disk] # lsof | grep 'Disc of demo of MS Server'
    disc of demo server lsof 1317 root cwd DIR 0,18 560/vmfs/volumes/4fb703b6-bb64840f-e817-02215eccbdbb/MS 21592
    disc of demo server grep 1318 root cwd DIR 0,18 560/vmfs/volumes/4fb703b6-bb64840f-e817-02215eccbdbb/MS 21592
    disc of demo server lsof 1319 root cwd DIR 0,18 560/vmfs/volumes/4fb703b6-bb64840f-e817-02215eccbdbb/MS 21592
    bash 16678 disc of demo server root cwd DIR 0,18 560/vmfs/volumes/4fb703b6-bb64840f-e817-02215eccbdbb/MS 21592

    No results appear if I lsof files themselves.

    I can kill these processes? I have not the option to restart the server.

    I've also seen mention of restart /sbin/servicesservices. SH , but I'm hesitant because I don't know what this will do - how does affect other virtual machines running?

    I'm running ESX 4.0.0 208167 (according to VCentre) and I watched as a result of discussions among others:

    http://communities.VMware.com/message/2037529

    http://communities.VMware.com/thread/126894

    http://communities.VMware.com/thread/246141

    http://KB.VMware.com/selfservice/microsites/search.do?language=en_US & cmd = displayKC & externalId = 10051


    Any help is greatly appreciated


    [MS root@ESX1 server demo disk] # rm - rf 2010-10A - 000001 - delta.vmdk
    RM: cannot remove "2010-10A - 000001 - delta.vmdk': device or resource busy"

    I've also seen mention of restart /sbin/servicesservices. SH , but I'm hesitant because I don't know what this will do - how does affect other virtual machines running?

    You can restart the services... There will be no impact to the VMS running... also try to restart VMware vCenter services (services.msc)

    If the above does not work, then restart the host seems to be the fastest and the most secure option.

  • Cannot remove Application - EnhancedVideo

    Hi all

    I am what OS x 10.7.5 on my power book and in the course of dealing with my insurance provider's website was forced to download an application called EnhancedVideo. He currently lives in my folder of the Application and cannot be deleted. When I try and move it to the trash an open box says that it cannot be moved to the Trash because it is open. If I open the window to leave, he doesn't seem to be running. I restarted my computer several times as well as closing all other running applications, including chrome, which it has been downloaded through.

    Please help, love to remove it because I do not use it. It gives me the willies spyware or malicious so that tweaking my OCD.

    Thank you!

    .

  • Cannot remove an e-mail account - no under account settings removal tool

    Use Thunderbird 24.5.0. Not having only not under one account choice account delete option. I tried to delete an e-mail account, but cannot remove or delete it. I read your solution but no delete option in the drop-down list in the account settings. help lease

    How about you go to the Tools menu > modules and disabling the add-on!

    Not that I can find a "manually change the files' on the site of the add-on.

    I can find a manually records sort that does exactly what it says, but does not add and the columns you show. I can also find "additional folder columns" which aims to give your comments headers. The page Add on like the third picture shows a right click option or click to turn on the power on and off columns.

  • Cannot remove iCloud backup of my old iphone

    I upgraded from an iPhone 4 to a 6 s iPhone yesterday. Activation and downloading my settings and applications from the iCloud went perfectly. I am now trying to delete the backup of the iPhone 4 on the iCloud, so I can have enough space to save my iPhone 6 s. I get a message, "this backup cannot remove because it is in use". Any suggestions?

    Hi Poppabear5,

    Congratulations on your new iPhone 6 s! I understand that you have a problem with deleting your iPhone upward iCloud. Let's see if we can understand what is happening.

    The type of message you see, looks like your iPhone 6s is not made backup upward. The best way to confirm this is to see if it is possible to make a backup with your iPhone 6s and see if Yes see a message in the sense of "this iPhone is currently being restored and will back up automatically when it's done.". If this is the case, then you want to wait for the restore before you delete the backup. Another thing to think about is if you still have your iPhone 4, make sure it is not turned on and backup. It would be considered in service as well.

    iCloud: alert messages of understanding when restoring a backup to iCloud
    https://support.Apple.com/en-us/HT203756

    Nice day

  • Cannot remove ilivid Control Panel and can not find any place to contact them - how to remove?

    Cannot remove Livid - Bando media using Control Panel - is there a free way to remove from the computer? cannot contact seems they don't want inquires

    Hello NickStoneburgh,

    What exactly you are trying to remove from Control Panel?  I am also having a difficulty finding a support contact for the media of Bando, but when you do a Bing search, I see others with the same question.

    When this software did get installed on your computer?  Have you installed any other software, and it has also been included?  If you can perform a system restore to a time before having this software.

    I don't know what operating system you use but have added a few links below.

    Windows 7 system restore

    What is system restore? Windows Vista

    Thank you

    James

  • Cannot remove make sure disk is not full or write protected

    Get the error message when you try to delete some desktop icons and a few files that says "can't remove...". Make sure that the disk is not full or write protected. "

    using windows xp sp home edition ver3. Cannot remove this things even logged on as administrator

    Hello

    Are what type of files?

    The programs are still installed on the system?

    Have you tried a reboot first, then try to delete icons?

    If the are left by a try to uninstall this program remove doctor 2.3

    and use the delete file then restart, let me know how you go

    http://www.Softpedia.com/get/system/OS-enhancements/delete-doctor.shtml

    Concerning

    GT4U

Maybe you are looking for