Review infra-hostrename SOP
Signed-off-by: Michal Konečný <mkonecny@redhat.com>
This commit is contained in:
parent
8ef38c5057
commit
8d66f2e477
2 changed files with 23 additions and 25 deletions
|
@ -49,7 +49,7 @@
|
||||||
** xref:hotfix.adoc[HOTFIXES - SOP]
|
** xref:hotfix.adoc[HOTFIXES - SOP]
|
||||||
** xref:hotness.adoc[The New Hotness - SOP]
|
** xref:hotness.adoc[The New Hotness - SOP]
|
||||||
** xref:infra-git-repo.adoc[Infrastructure Git Repos - SOP]
|
** xref:infra-git-repo.adoc[Infrastructure Git Repos - SOP]
|
||||||
** xref:infra-hostrename.adoc[infra-hostrename - SOP in review ]
|
** xref:infra-hostrename.adoc[Infrastructure Host Rename - SOP]
|
||||||
** xref:infra-raidmismatch.adoc[infra-raidmismatch - SOP in review ]
|
** xref:infra-raidmismatch.adoc[infra-raidmismatch - SOP in review ]
|
||||||
** xref:infra-repo.adoc[infra-repo - SOP in review ]
|
** xref:infra-repo.adoc[infra-repo - SOP in review ]
|
||||||
** xref:infra-retiremachine.adoc[infra-retiremachine - SOP in review ]
|
** xref:infra-retiremachine.adoc[infra-retiremachine - SOP in review ]
|
||||||
|
|
|
@ -5,31 +5,29 @@ virtual node.
|
||||||
|
|
||||||
== Contents
|
== Contents
|
||||||
|
|
||||||
[arabic]
|
* <<_introduction>>
|
||||||
. Introduction
|
* <<_finding_out_where_the_host_is>>
|
||||||
. Finding out where the host is
|
* <<_preparation>>
|
||||||
. Preparation
|
* <<_renaming_the_logical_volume>>
|
||||||
. Renaming the Logical Volume
|
* <<_doing_the_actual_rename>>
|
||||||
. Doing the actual rename
|
* <<_vpn_stuff>>
|
||||||
. Telling ansible about the new host
|
|
||||||
. VPN Stuff
|
|
||||||
|
|
||||||
== Introduction
|
== Introduction
|
||||||
|
|
||||||
Throughout this SOP, we will refer to the old hostname as $oldhostname
|
Throughout this SOP, we will refer to the old hostname as $oldhostname
|
||||||
and the new hostname as $newhostname. We will refer to the Dom0 host
|
and the new hostname as $newhostname. We will refer to the Dom0 host
|
||||||
that the vm resides on as $vmhost.
|
that the vm resides on as `$vmhost`.
|
||||||
|
|
||||||
If this process is being followed so that a temporary-named host can
|
If this process is being followed so that a temporary-named host can
|
||||||
replace a production host, please be sure to follow the
|
replace a production host, please be sure to follow the
|
||||||
[51]Infrastructure retire machine SOP to properly decommission the old
|
xref:infra-retiremachine.adoc[Infrastructure retire machine SOP] to properly
|
||||||
host before continuing.
|
decommission the old host before continuing.
|
||||||
|
|
||||||
== Finding out where the host is
|
== Finding out where the host is
|
||||||
|
|
||||||
In order to rename the host, you must have access to the Dom0 (host) on
|
In order to rename the host, you must have access to the _Dom0_ (host) on
|
||||||
which the virtual server resides. To find out which host that is, log in
|
which the virtual server resides. To find out which host that is, log in
|
||||||
to batcave01, and run:
|
to _batcave01_, and run:
|
||||||
|
|
||||||
....
|
....
|
||||||
grep $oldhostname /var/log/virthost-lists.out
|
grep $oldhostname /var/log/virthost-lists.out
|
||||||
|
@ -39,15 +37,15 @@ The first column of the output will be the Dom0 of the virtual node.
|
||||||
|
|
||||||
== Preparation
|
== Preparation
|
||||||
|
|
||||||
SSH to $oldhostname. If the new name is replacing a production box,
|
SSH to `$oldhostname`. If the new name is replacing a production box,
|
||||||
change the IP Address that it binds to, in
|
change the IP Address that it binds to, in
|
||||||
`/etc/sysconfig/network-scripts/ifcfg-eth0`.
|
`/etc/sysconfig/network-scripts/ifcfg-eth0`.
|
||||||
|
|
||||||
Also change the hostname in `/etc/sysconfig/network`.
|
Also change the hostname in `/etc/sysconfig/network`.
|
||||||
|
|
||||||
At this point, you can `sudo poweroff` $oldhostname.
|
At this point, you can `sudo poweroff` `$oldhostname`.
|
||||||
|
|
||||||
Open an ssh session to $vmhost, and make sure that the node is listed as
|
Open an ssh session to `$vmhost`, and make sure that the node is listed as
|
||||||
`shut off`. If it is not, you can force it off with:
|
`shut off`. If it is not, you can force it off with:
|
||||||
|
|
||||||
....
|
....
|
||||||
|
@ -56,7 +54,7 @@ virsh destroy $oldhostname
|
||||||
|
|
||||||
== Renaming the Logical Volume
|
== Renaming the Logical Volume
|
||||||
|
|
||||||
Find out the name of the logical volume (on $vmhost):
|
Find out the name of the logical volume (on `$vmhost`):
|
||||||
|
|
||||||
....
|
....
|
||||||
virsh dumpxml $oldhostname | grep 'source dev'
|
virsh dumpxml $oldhostname | grep 'source dev'
|
||||||
|
@ -67,24 +65,24 @@ This will give you a line that looks like
|
||||||
`/dev/VolGroup00/$oldhostname` is the path to the logical volume.
|
`/dev/VolGroup00/$oldhostname` is the path to the logical volume.
|
||||||
|
|
||||||
Run `/usr/sbin/lvrename` (the path that you found above) (the path that
|
Run `/usr/sbin/lvrename` (the path that you found above) (the path that
|
||||||
you found above, with $newhostname at the end instead of $oldhostname)`
|
you found above, with `$newhostname` at the end instead of `$oldhostname`)`
|
||||||
|
|
||||||
For example::::
|
For example::
|
||||||
/usr/sbin/lvrename /dev/VolGroup00/noc03-tmp /dev/VolGroup00/noc01
|
`/usr/sbin/lvrename /dev/VolGroup00/noc03-tmp /dev/VolGroup00/noc01`
|
||||||
|
|
||||||
== Doing the actual rename
|
== Doing the actual rename
|
||||||
|
|
||||||
Now that the logical volume has been renamed, we can rename the host in
|
Now that the logical volume has been renamed, we can rename the host in
|
||||||
libvirt.
|
libvirt.
|
||||||
|
|
||||||
Dump the configuration of $oldhostname into an xml file, by running:
|
Dump the configuration of `$oldhostname` into an xml file, by running:
|
||||||
|
|
||||||
....
|
....
|
||||||
virsh dumpxml $oldhostname > $newhostname.xml
|
virsh dumpxml $oldhostname > $newhostname.xml
|
||||||
....
|
....
|
||||||
|
|
||||||
Open up $newhostname.xml, and change all instances of $oldhostname to
|
Open up `$newhostname.xml`, and change all instances of `$oldhostname` to
|
||||||
$newhostname.
|
`$newhostname`.
|
||||||
|
|
||||||
Save the file and run:
|
Save the file and run:
|
||||||
|
|
||||||
|
@ -92,7 +90,7 @@ Save the file and run:
|
||||||
virsh define $newhostname.xml
|
virsh define $newhostname.xml
|
||||||
....
|
....
|
||||||
|
|
||||||
If there are no errors above, you can undefine $oldhostname:
|
If there are no errors above, you can undefine `$oldhostname`:
|
||||||
|
|
||||||
....
|
....
|
||||||
virsh undefine $oldhostname
|
virsh undefine $oldhostname
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue