Присвоение IP VMware vSphere

Вы не говорите нам достаточно:

Вы используете аппаратный RAID-контроллер? Какой? В противном случае программное обеспечение RAID, на какой операционная система? Восстановление имело законченным, не сообщая ни о каких ошибках? Инструменты управления RAID для решения RAID Вы используете, сообщает объем как то, чтобы хорошо работать? Какие ошибки ввода-вывода Вы получаете? О них сообщает хост ОС или гостевая машина?

Кроме того, я не могу не отметить, что необходимо было начать волновать шесть месяцев назад, когда диск перестал работать. Если диск перестал работать в установке RAID, необходимо сразу заменить его, особенно с RAID5. Любая ошибка на одном из остающихся дисков приведет восстановление к сбою, таким образом, не будет никакого времени для выпуска.

2
задан 9 September 2013 в 11:39
1 ответ

The issue you're running into is that MAC addresses must be unique so when a machine is cloned the mac addresses are regenerated. Unfortunately reconfiguring your network config files to reflect the new MAC is not something that vmware tools takes care of. Additionally, CentOS will have seen that there is already an eth0 interface and put the new MAC on a new eth1 interface.

This vmware KB has your issue: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2002767

The fix can be easily scripted and I'm sure access to vcloud automation center or a similar service would facilitate that.

A simple first boot type script that could take care of it would do the following:

  • Find the new MAC that was generated (will be configured as eth1 if the VM only has one adapter)
  • Replace the MAC in ifcfg-eth0 with the MAC found in ifcfg-eth1
  • Remove 70-persistent-net.rules
  • Reboot the VM

Script example below:

#!/bin/sh

#Find the MAC that was generated for the clone (assumes only one network adapter added to the VM)
NEW_MAC=`/sbin/ifconfig eth1 |grep -i hwaddr |awk {'print $5'}`

#Replace the MAC in the eth0 file 
/bin/sed -i "s/HWADDR.*/HWADDR=$NEW_MAC/" /etc/sysconfig/network-scripts/ifcfg-eth0

#Delete the net rules file
/bin/rm /etc/udev/rules.d/70-persistent-net.rules
2
ответ дан 3 December 2019 в 11:46

Теги

Похожие вопросы