In some rare situations you may get a request to change the name of the LDOM. This can be done in 2 ways.
1. Using live migration (can be done online)
2. By editing XML constraints file (requires downtime)
Using live migration feature (online)
In this case we migrate the guest LDOM to another machine and then again migrate it to the original machine with the new name.
source-machine # ldm migrate oldname destination-machine destination-machine # ldm migrate oldname machineA:newname
For more info on live migration refer the post : LDOM live migration basics explained
Editing the constraints (reboot required)
Another way of changing the LDOM name is to edit the constraints XML file. For this save the guest domain config into an XML file
# ldm list-constraints -x oldname >/tmp/oldname.xml
Shutdown and un-bind the Guest LDOM :
# ldm stop oldname # ldm unbind oldname
Copy the XML file as the new LDOM XML file and edit file to replace the oldname to newname :
# cp /tmp/oldname.xml /tmp/newname.xml # vi /tmp/newname.xml Content xsi:type="ovf:VirtualSystem_Type" ovf:id="oldname"
Destroy the old Guest LDOM :
# ldm destroy oldname
Create the new Guest LDOM using the edited XML file :
# ldm add-domain -i tmp/newname.xml
Bind and start the new guest domain :
# ldm bind newname # ldm start newname
Verify the new name of Guest LDOM :
# ldm list NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME primary active -n-cv SP 8 4G 0.3% 8h 46m newname active -n--- 5000 8 2G 48% 1h 52m