Disclaimer: I test following procedure to rename the guest domain. It worked for me, but it’s may not be the right procedure. Do not try on your prod environment
Rename the Guest domain:
==========================
Bring down the guest domain OS to OK prompt
bash-3.2# ldm list old-ldg1
NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME
old-ldg1 active -t—- 5000 16 8G 6.2% 23h 17m
#ldm stop-domain old-ldg1
LDom old-ldg1 stopped
bash-3.2# ldm list old-ldg1
NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME
old-ldg1 bound —— 5000 16 8G
Then run unbind command, it will change to inactive state
bash-3.2# ldm unbind old-ldg1
bash-3.2# ldm list old-ldg1
NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME
old-ldg1 inactive —— 16 8G
Save the guest domain configuration to a xml
bash-3.2# ldm list-constraints -x old-ldg1 > /var/tmp/old-ldg1.xml
Create copy of the xmls
cp -p /var/tmp/old-ldg1.xml /var/tmp/new-ldg1.xml
bash-3.2# grep -i sngcgpsqap31 /var/tmp/old-ldg1.xml
<Content xsi:type=”ovf:VirtualSystem_Type” ovf:id=”old-ldg1″>
<gprop:GenericProperty key=”vol_name”>sngcgpsqap31_sys</gprop:GenericProperty>
<gprop:GenericProperty key=”vol_name”>sngcgpsqap31_sys</gprop:GenericProperty>
<gprop:GenericProperty key=”block_dev”>/dev/zvol/dsk/root/vdsk_sngcgpsqap31_sys</gprop:GenericProperty>
bash-3.2# cp /var/tmp/old-ldg1.xml /var/tmp/new-ldg1.xml
psqap31.xmlerl -pi -e ‘s/old-ldg1/new-ldg1/g’ /var/tmp/ldg-sngcg
bash-3.2# grep -i sngcgpsqap31 /var/tmp/new-ldg1.xml
<Content xsi:type=”ovf:VirtualSystem_Type” ovf:id=”new-ldg1″>
<gprop:GenericProperty key=”vol_name”>sngcgpsqap31_sys</gprop:GenericProperty>
<gprop:GenericProperty key=”vol_name”>sngcgpsqap31_sys</gprop:GenericProperty>
<gprop:GenericProperty key=”block_dev”>/dev/zvol/dsk/root/vdsk_sngcgpsqap31_sys</gprop:GenericProperty>
bash-3.2# ldm add-domain -i /var/tmp/new-ldg1.xml
bash-3.2# ldm list
NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME
primary active -n-cv- UART 8 1G 1.1% 1d 3h 24m
new-ldg1 inactive —— 16 8G
bash-3.2# ldm bind new-ldg1
bash-3.2# ldm start new-ldg1
LDom new-ldg1 started
bash-3.2# ldm list
NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME
primary active -n-cv- UART 8 1G 4.8% 1d 3h 25m
new-ldg1 active -t—- 5000 16 8G 3.5% 2s
Verify connecting to new guest domain console:
bash-3.2# telnet localhost 5000
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
Connecting to console “new-ldg1″ in group “new-ldg1″ ….
Press ~? for control options ..
{0} ok
telnet> quit
Connection to localhost closed.
bash-3.2#
Filed under: LDOM, Solaris Tagged: ldoms, solaris, solaris ldom
