@ypu  here add this line is make sure the nic that nic_index point have a ip address. if we using vm.get_address() before the nic have configured a ip address will raise error, so better add this line.